| 1 |
# - Try to find NaCl |
| 2 |
# Once done this will define |
| 3 |
# |
| 4 |
# NACL_FOUND - system has NaCl |
| 5 |
# NACL_INCLUDE_DIRS - the NaCl include directory |
| 6 |
# NACL_LIBRARIES - Link these to use NaCl |
| 7 |
# NACL_DEFINITIONS - Compiler switches required for using NaCl |
| 8 |
# |
| 9 |
# Copyright (c) 2010 Andreas Schneider <[email protected]> |
| 10 |
# Copyright (c) 2013 Aris Adamantiadis <[email protected]> |
| 11 |
# |
| 12 |
# Redistribution and use is allowed according to the terms of the New |
| 13 |
# BSD license. |
| 14 |
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
| 15 |
# |
| 16 |
|
| 17 |
|
| 18 |
if (NACL_LIBRARIES AND NACL_INCLUDE_DIRS) |
| 19 |
# in cache already |
| 20 |
set(NACL_FOUND TRUE) |
| 21 |
else (NACL_LIBRARIES AND NACL_INCLUDE_DIRS) |
| 22 |
|
| 23 |
find_path(NACL_INCLUDE_DIR |
| 24 |
NAMES |
| 25 |
nacl/crypto_box_curve25519xsalsa20poly1305.h |
| 26 |
PATHS |
| 27 |
/usr/include |
| 28 |
/usr/local/include |
| 29 |
/opt/local/include |
| 30 |
/sw/include |
| 31 |
) |
| 32 |
|
| 33 |
find_library(NACL_LIBRARY |
| 34 |
NAMES |
| 35 |
nacl |
| 36 |
PATHS |
| 37 |
/usr/lib |
| 38 |
/usr/local/lib |
| 39 |
/opt/local/lib |
| 40 |
/sw/lib |
| 41 |
) |
| 42 |
|
| 43 |
set(NACL_INCLUDE_DIRS |
| 44 |
${NACL_INCLUDE_DIR} |
| 45 |
) |
| 46 |
|
| 47 |
if (NACL_LIBRARY) |
| 48 |
set(NACL_LIBRARIES |
| 49 |
${NACL_LIBRARIES} |
| 50 |
${NACL_LIBRARY} |
| 51 |
) |
| 52 |
endif (NACL_LIBRARY) |
| 53 |
|
| 54 |
include(FindPackageHandleStandardArgs) |
| 55 |
find_package_handle_standard_args(NaCl DEFAULT_MSG NACL_LIBRARIES NACL_INCLUDE_DIRS) |
| 56 |
|
| 57 |
# show the NACL_INCLUDE_DIRS and NACL_LIBRARIES variables only in the advanced view |
| 58 |
mark_as_advanced(NACL_INCLUDE_DIRS NACL_LIBRARIES) |
| 59 |
|
| 60 |
endif (NACL_LIBRARIES AND NACL_INCLUDE_DIRS) |
| 61 |
|