summaryrefslogtreecommitdiffstats
path: root/cmake/deps.cmake
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-11-02 17:42:30 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-11-02 17:47:20 +0100
commit38b7d50694b4a9929cc0d5bca884a52d5aeaa8a4 (patch)
tree8d5c690296423b9261a864c1b8cfde06b85d9d9a /cmake/deps.cmake
parentcd47acaf3cc874f8d26acca56fa6cef6110d946d (diff)
downloadfastd-38b7d50694b4a9929cc0d5bca884a52d5aeaa8a4.tar
fastd-38b7d50694b4a9929cc0d5bca884a52d5aeaa8a4.zip
Separate cmake files
Diffstat (limited to 'cmake/deps.cmake')
-rw-r--r--cmake/deps.cmake46
1 files changed, 46 insertions, 0 deletions
diff --git a/cmake/deps.cmake b/cmake/deps.cmake
new file mode 100644
index 0000000..e49efcd
--- /dev/null
+++ b/cmake/deps.cmake
@@ -0,0 +1,46 @@
+find_package(BISON 2.5 REQUIRED)
+
+set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+find_package(Threads)
+if(NOT CMAKE_USE_PTHREADS_INIT)
+ MESSAGE(FATAL_ERROR "No pthread support found.")
+endif(NOT CMAKE_USE_PTHREADS_INIT)
+
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(UECC REQUIRED libuecc>=3)
+
+
+set(NACL_INCLUDE_DIRS "")
+set(NACL_CFLAGS_OTHER "")
+set(NACL_LIBRARY_DIRS "")
+set(NACL_LIBRARIES "")
+set(NACL_LDFLAGS_OTHER "")
+
+if(WITH_METHOD_XSALSA20_POLY1305 OR WITH_CIPHER_AES128_CTR_NACL)
+ 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}")
+ else(USE_LIBSODIUM)
+ find_package(NaCl REQUIRED)
+
+ set(NACL_INCLUDE_DIRS "${NACL_INCLUDE_DIR}")
+ set(NACL_LIBRARIES "${NACL_LIBRARY}")
+ endif(USE_LIBSODIUM)
+endif()
+
+
+if(WITH_CAPABILITIES)
+ find_package(CAP REQUIRED)
+else(WITH_CAPABILITIES)
+ set(CAP_INCLUDE_DIR "")
+ set(CAP_LIBRARY "")
+endif(WITH_CAPABILITIES)