diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-03 11:12:42 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-03 11:12:42 +0100 |
commit | b117a60e81c3d67880cd8b0079041c92a0818d96 (patch) | |
tree | 8db87c3e0710ce5b2201d7734a93dd3024631b1c /cmake/deps.cmake | |
parent | 7fe38b0200979c15cc27a84ab51b2730e7f2d30e (diff) | |
download | fastd-b117a60e81c3d67880cd8b0079041c92a0818d96.tar fastd-b117a60e81c3d67880cd8b0079041c92a0818d96.zip |
Allow building without NaCl again
Diffstat (limited to 'cmake/deps.cmake')
-rw-r--r-- | cmake/deps.cmake | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/cmake/deps.cmake b/cmake/deps.cmake index fa3cb03..c3936af 100644 --- a/cmake/deps.cmake +++ b/cmake/deps.cmake @@ -17,24 +17,30 @@ set(NACL_LIBRARIES "") set(NACL_LDFLAGS_OTHER "") if(USE_LIBSODIUM) - pkg_check_modules(SODIUM REQUIRED libsodium) - - set(NACL_INCLUDE_DIRS "${SODIUM_INCLUDE_DIRS}") - foreach(dir "${SODIUM_INCLUDEDIR}" ${SODIUM_INCLUDE_DIRS}) - list(APPEND NACL_INCLUDE_DIRS "${dir}/sodium") - endforeach(dir) - - set(NACL_CFLAGS_OTHER "${SODIUM_CFLAGS_OTHER}") - set(NACL_LIBRARY_DIRS "${SODIUM_LIBRARY_DIRS}") - set(NACL_LIBRARIES "${SODIUM_LIBRARIES}") - set(NACL_LDFLAGS_OTHER "${SODIUM_LDFLAGS_OTHER}") + pkg_check_modules(SODIUM libsodium) + + if(SODIUM_FOUND) + set(NACL_INCLUDE_DIRS "${SODIUM_INCLUDE_DIRS}") + foreach(dir "${SODIUM_INCLUDEDIR}" ${SODIUM_INCLUDE_DIRS}) + list(APPEND NACL_INCLUDE_DIRS "${dir}/sodium") + endforeach(dir) + + set(NACL_CFLAGS_OTHER "${SODIUM_CFLAGS_OTHER}") + set(NACL_LIBRARY_DIRS "${SODIUM_LIBRARY_DIRS}") + set(NACL_LIBRARIES "${SODIUM_LIBRARIES}") + set(NACL_LDFLAGS_OTHER "${SODIUM_LDFLAGS_OTHER}") + endif(SODIUM_FOUND) else(USE_LIBSODIUM) - find_package(NaCl REQUIRED) + find_package(NaCl) - set(NACL_INCLUDE_DIRS "${NACL_INCLUDE_DIR}") - set(NACL_LIBRARIES "${NACL_LIBRARY}") + if(NACL_FOUND) + set(NACL_INCLUDE_DIRS "${NACL_INCLUDE_DIR}") + set(NACL_LIBRARIES "${NACL_LIBRARY}") + endif(NACL_FOUND) endif(USE_LIBSODIUM) +set_property(GLOBAL PROPERTY NACL_REQUIRED FALSE) + if(WITH_CAPABILITIES) find_package(CAP REQUIRED) |