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:
Wilhelm Schuermann 2015-06-22 21:06:28 +02:00
parent 53f7786da5
commit de8eb2814b
3 changed files with 39 additions and 6 deletions

View file

@ -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)

View file

@ -22,6 +22,9 @@ Babej).
enabled.
- Internal plumbing: Use variadic templates for format(), reducing code bloat
and enabling more flexible use of the function.
- Enable "task sync" support by default. "cmake -DENABLE_SYNC=OFF" allows
disabling it and building Taskwarrior without libgnutls available.
------ current release ---------------------------

19
INSTALL
View file

@ -91,6 +91,25 @@ get absolute installation directories:
CMAKE_INSTALL_PREFIX/TASK_MAN5DIR /usr/local/share/man/man5
"sync" command
--------------
In order to enable the "sync" command, you will need to have GnuTLS available.
cmake may fail with the following error message:
"Cannot find GnuTLS. Use -DENABLE_SYNC=OFF to build Taskwarrior without
sync support. See INSTALL for more information."
This means that it cannot find your GnuTLS installation, and you will need to
install GnuTLS as well as its header files. For Debian based distributions,
installing "libgnutls-dev" is usually sufficient.
In order to build Taskwarrior without "sync" support, call cmake with the
"-DENABLE_SYNC=OFF" flag:
$ cmake . -DENABLE_SYNC=OFF
and proceed as described in "Basic Installation".
Localizations
-------------