CMake: Require libgnutls by default.
- Make cmake complain and abort the build process if libgnutls is not available. In order to build Taskwarrior without "sync" support, or to build it on a system with libgnutls missing, the new cmake flag "-DENABLE_SYNC=OFF" can be used.
This commit is contained in:
@@ -12,7 +12,14 @@ set (HAVE_CMAKE true)
|
||||
project (task)
|
||||
set (PROJECT_VERSION "2.4.5")
|
||||
|
||||
OPTION(USE_GNUTLS "Build gnutls support." ON)
|
||||
OPTION (ENABLE_SYNC "Enable 'task sync' support" ON)
|
||||
|
||||
if (ENABLE_SYNC)
|
||||
set (USE_GNUTLS ON CACHE BOOL "Build gnutls support." FORCE)
|
||||
else (ENABLE_SYNC)
|
||||
set (USE_GNUTLS OFF CACHE BOOL "Build gnutls support." FORCE)
|
||||
message (WARNING "ENABLE_SYNC=OFF. Not building sync support.")
|
||||
endif (ENABLE_SYNC)
|
||||
|
||||
message ("CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
|
||||
|
||||
@@ -116,6 +123,10 @@ if (USE_GNUTLS)
|
||||
endif (GNUTLS_FOUND)
|
||||
endif (USE_GNUTLS)
|
||||
|
||||
if (ENABLE_SYNC AND NOT GNUTLS_FOUND)
|
||||
message (FATAL_ERROR "Cannot find GnuTLS. Use -DENABLE_SYNC=OFF to build Taskwarrior without sync support. See INSTALL for more information.")
|
||||
endif (ENABLE_SYNC AND NOT GNUTLS_FOUND)
|
||||
|
||||
check_function_exists (timegm HAVE_TIMEGM)
|
||||
check_function_exists (get_current_dir_name HAVE_GET_CURRENT_DIR_NAME)
|
||||
check_function_exists (wordexp HAVE_WORDEXP)
|
||||
|
||||
Reference in New Issue
Block a user