summaryrefslogtreecommitdiffstats
path: root/libssh/cmake/Modules/FindNaCl.cmake
diff options
context:
space:
mode:
authorNicolas Viennot <nicolas@viennot.biz>2013-11-10 02:46:15 -0500
committerNicolas Viennot <nicolas@viennot.biz>2013-11-10 02:46:15 -0500
commitdfe63e9e738bff7764f65ffe4449088f4a13feca (patch)
tree46d4b4c2b1f8d05108b2e51a9bd1291316176adb /libssh/cmake/Modules/FindNaCl.cmake
parent2535b531bb73cd8c99e5bf9726d8b645108ddd02 (diff)
Forgot some libssh files
Diffstat (limited to 'libssh/cmake/Modules/FindNaCl.cmake')
-rw-r--r--libssh/cmake/Modules/FindNaCl.cmake61
1 files changed, 61 insertions, 0 deletions
diff --git a/libssh/cmake/Modules/FindNaCl.cmake b/libssh/cmake/Modules/FindNaCl.cmake
new file mode 100644
index 00000000..fa9c4090
--- /dev/null
+++ b/libssh/cmake/Modules/FindNaCl.cmake
@@ -0,0 +1,61 @@
+# - Try to find NaCl
+# Once done this will define
+#
+# NACL_FOUND - system has NaCl
+# NACL_INCLUDE_DIRS - the NaCl include directory
+# NACL_LIBRARIES - Link these to use NaCl
+# NACL_DEFINITIONS - Compiler switches required for using NaCl
+#
+# Copyright (c) 2010 Andreas Schneider <asn@cynapses.org>
+# Copyright (c) 2013 Aris Adamantiadis <aris@badcode.be>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (NACL_LIBRARIES AND NACL_INCLUDE_DIRS)
+ # in cache already
+ set(NACL_FOUND TRUE)
+else (NACL_LIBRARIES AND NACL_INCLUDE_DIRS)
+
+ find_path(NACL_INCLUDE_DIR
+ NAMES
+ nacl/crypto_box_curve25519xsalsa20poly1305.h
+ PATHS
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ )
+
+ find_library(NACL_LIBRARY
+ NAMES
+ nacl
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ set(NACL_INCLUDE_DIRS
+ ${NACL_INCLUDE_DIR}
+ )
+
+ if (NACL_LIBRARY)
+ set(NACL_LIBRARIES
+ ${NACL_LIBRARIES}
+ ${NACL_LIBRARY}
+ )
+ endif (NACL_LIBRARY)
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(NaCl DEFAULT_MSG NACL_LIBRARIES NACL_INCLUDE_DIRS)
+
+ # show the NACL_INCLUDE_DIRS and NACL_LIBRARIES variables only in the advanced view
+ mark_as_advanced(NACL_INCLUDE_DIRS NACL_LIBRARIES)
+
+endif (NACL_LIBRARIES AND NACL_INCLUDE_DIRS)
+