Debian Codegraph @

cmake/FindGCrypt.cmake

raw
1 # - Try to find GCrypt
2 # Once done this will define
3 #
4 # GCRYPT_FOUND - system has GCrypt
5 # GCRYPT_INCLUDE_DIRS - the GCrypt include directory
6 # GCRYPT_LIBRARIES - Link these to use GCrypt
7 # GCRYPT_DEFINITIONS - Compiler switches required for using GCrypt
8 #
9 #=============================================================================
10 # Copyright (c) 2009-2011 Andreas Schneider <[email protected]>
11 #
12 # Distributed under the OSI-approved BSD License (the "License");
13 # see accompanying file Copyright.txt for details.
14 #
15 # This software is distributed WITHOUT ANY WARRANTY; without even the
16 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 # See the License for more information.
18 #=============================================================================
19 #
20
21 if (GCRYPT_LIBRARIES AND GCRYPT_INCLUDE_DIRS)
22 # in cache already
23 # set(GCRYPT_FOUND TRUE)
24 else (GCRYPT_LIBRARIES AND GCRYPT_INCLUDE_DIRS)
25
26 set(_GCRYPT_ROOT_PATHS
27 "$ENV{PROGRAMFILES}/libgcrypt"
28 )
29
30 find_path(GCRYPT_ROOT_DIR
31 NAMES
32 include/gcrypt.h
33 PATHS
34 ${_GCRYPT_ROOT_PATHS}
35 )
36 mark_as_advanced(ZLIB_ROOT_DIR)
37
38 find_path(GCRYPT_INCLUDE_DIR
39 NAMES
40 gcrypt.h
41 PATHS
42 /usr/local/include
43 /opt/local/include
44 /sw/include
45 /usr/lib/sfw/include
46 ${GCRYPT_ROOT_DIR}/include
47 )
48 set(GCRYPT_INCLUDE_DIRS ${GCRYPT_INCLUDE_DIR})
49
50 find_library(GCRYPT_LIBRARY
51 NAMES
52 gcrypt
53 gcrypt11
54 libgcrypt-11
55 PATHS
56 /opt/local/lib
57 /sw/lib
58 /usr/sfw/lib/64
59 /usr/sfw/lib
60 ${GCRYPT_ROOT_DIR}/lib
61 )
62 set(GCRYPT_LIBRARIES ${GCRYPT_LIBRARY})
63
64 include(FindPackageHandleStandardArgs)
65 find_package_handle_standard_args(GCrypt DEFAULT_MSG GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIRS)
66
67 # show the GCRYPT_INCLUDE_DIRS and GCRYPT_LIBRARIES variables only in the advanced view
68 mark_as_advanced(GCRYPT_INCLUDE_DIRS GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIR GCRYPT_LIBRARY GCRYPT_ROOT_DIR)
69
70 endif (GCRYPT_LIBRARIES AND GCRYPT_INCLUDE_DIRS)