summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/FindSODIUM.cmake70
-rw-r--r--docs/commands.rst4
2 files changed, 63 insertions, 11 deletions
diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake
index ffb6a1f7..fd6206ff 100644
--- a/cmake/FindSODIUM.cmake
+++ b/cmake/FindSODIUM.cmake
@@ -1,15 +1,67 @@
1# Find SODIUM 1# - Try to find SODIUM
2# Once done this will define
2# 3#
3# SODIUM_INCLUDE_DIR 4# SODIUM_ROOT_DIR - Set this variable to the root installation of CMocka
4# SODIUM_LIBRARY
5# SODIUM_FOUND
6# 5#
6# Read-Only variables:
7# SODIUM_FOUND - system has SODIUM
8# SODIUM_INCLUDE_DIR - the SODIUM include directory
9# SODIUM_LIBRARIES - Link these to use SODIUM
10# SODIUM_DEFINITIONS - Compiler switches required for using SODIUM
11#
12#=============================================================================
13# Copyright (c) 2013 Andreas Schneider <asn@cryptomilk.org>
14#
15# Distributed under the OSI-approved BSD License (the "License");
16# see accompanying file Copyright.txt for details.
17#
18# This software is distributed WITHOUT ANY WARRANTY; without even the
19# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20# See the License for more information.
21#=============================================================================
22#
23
24set(_SODIUM_ROOT_HINTS
25)
26
27set(_SODIUM_ROOT_PATHS
28 "$ENV{PROGRAMFILES}/sodium"
29)
30
31find_path(SODIUM_ROOT_DIR
32 NAMES
33 include/cmocka.h
34 HINTS
35 ${_SODIUM_ROOT_HINTS}
36 PATHS
37 ${_SODIUM_ROOT_PATHS}
38)
39mark_as_advanced(SODIUM_ROOT_DIR)
40
41find_path(SODIUM_INCLUDE_DIR
42 NAMES
43 sodium.h
44 PATHS
45 ${SODIUM_ROOT_DIR}/include
46)
47
48find_library(SODIUM_LIBRARY
49 NAMES
50 sodium
51 PATHS
52 ${SODIUM_ROOT_DIR}/lib
53)
7 54
8FIND_PATH(SODIUM_INCLUDE_DIR NAMES sodium.h) 55if (SODIUM_LIBRARY)
56 set(SODIUM_LIBRARIES
57 ${SODIUM_LIBRARIES}
58 ${SODIUM_LIBRARY}
59 )
60endif (SODIUM_LIBRARY)
9 61
10FIND_LIBRARY(SODIUM_LIBRARY NAMES sodium) 62include(FindPackageHandleStandardArgs)
63find_package_handle_standard_args(SODIUM DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIR)
11 64
12INCLUDE(FindPackageHandleStandardArgs) 65# show the SODIUM_INCLUDE_DIR and SODIUM_LIBRARIES variables only in the advanced view
13FIND_PACKAGE_HANDLE_STANDARD_ARGS(SODIUM DEFAULT_MSG SODIUM_LIBRARY SODIUM_INCLUDE_DIR) 66mark_as_advanced(SODIUM_INCLUDE_DIR SODIUM_LIBRARIES)
14 67
15MARK_AS_ADVANCED(SODIUM_INCLUDE_DIR SODIUM_LIBRARY)
diff --git a/docs/commands.rst b/docs/commands.rst
index ab7e60d1..45b50c83 100644
--- a/docs/commands.rst
+++ b/docs/commands.rst
@@ -41,8 +41,8 @@ this.
41 41
42 - Print some help. 42 - Print some help.
43 43
44- */q/* 44- */q*
45 45
46 - Quit Tox. (why ;\_;) 46 - Quit Tox.
47 47
48 48