summaryrefslogtreecommitdiff
path: root/cmake/FindSODIUM.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindSODIUM.cmake')
-rw-r--r--cmake/FindSODIUM.cmake75
1 files changed, 0 insertions, 75 deletions
diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake
deleted file mode 100644
index 6b0c2f23..00000000
--- a/cmake/FindSODIUM.cmake
+++ /dev/null
@@ -1,75 +0,0 @@
1# - Try to find SODIUM
2# Once done this will define
3#
4# SODIUM_ROOT_DIR - Set this variable to the root installation of CMocka
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 "${CMAKE_SOURCE_DIR}/sodium"
30)
31
32find_path(SODIUM_ROOT_DIR
33 NAMES
34 include/sodium.h
35 HINTS
36 ${_SODIUM_ROOT_HINTS}
37 PATHS
38 ${_SODIUM_ROOT_PATHS}
39)
40mark_as_advanced(SODIUM_ROOT_DIR)
41
42find_path(SODIUM_INCLUDE_DIR
43 NAMES
44 sodium.h
45 PATHS
46 ${SODIUM_ROOT_DIR}/include
47)
48
49if(SHARED_LIBSODIUM)
50 set(WIN32_LIBSODIUM_FILENAME libsodium.dll.a)
51else()
52 set(WIN32_LIBSODIUM_FILENAME libsodium.a)
53endif()
54
55find_library(SODIUM_LIBRARY
56 NAMES
57 sodium
58 ${WIN32_LIBSODIUM_FILENAME}
59 PATHS
60 ${SODIUM_ROOT_DIR}/lib
61)
62
63if (SODIUM_LIBRARY)
64 set(SODIUM_LIBRARIES
65 ${SODIUM_LIBRARIES}
66 ${SODIUM_LIBRARY}
67 )
68endif (SODIUM_LIBRARY)
69
70include(FindPackageHandleStandardArgs)
71find_package_handle_standard_args(SODIUM DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIR)
72
73# show the SODIUM_INCLUDE_DIR and SODIUM_LIBRARIES variables only in the advanced view
74mark_as_advanced(SODIUM_INCLUDE_DIR SODIUM_LIBRARIES)
75