diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2013-09-21 23:32:51 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2013-11-03 13:18:26 +0100 |
commit | f565aeebfa108d03e5c782881edd2ced849a4989 (patch) | |
tree | e0c68647e4f7c54adfee6b98fe34c57ba40e0e77 /cmake | |
parent | 04cb94a2ddb091c82764ed2b3981f891b093d5d3 (diff) | |
download | libssh-f565aeebfa108d03e5c782881edd2ced849a4989.tar.gz libssh-f565aeebfa108d03e5c782881edd2ced849a4989.tar.xz libssh-f565aeebfa108d03e5c782881edd2ced849a4989.zip |
Compile libssh with nacl if possible
Conflicts:
DefineOptions.cmake
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/FindNaCl.cmake | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/cmake/Modules/FindNaCl.cmake b/cmake/Modules/FindNaCl.cmake new file mode 100644 index 00000000..fa9c4090 --- /dev/null +++ b/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) + |