~timkross/cjdns/cjdns

« back to all changes in this revision

Viewing changes to cmake/modules/FindGCrypt.cmake

  • Committer: cjdelisle
  • Date: 2011-02-16 23:03:00 UTC
  • Revision ID: git-v1:d475c9c10adc25590bea5e7dc5383b32f66d5eb8
First commit for cjdns.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
if (GCRYPT_INCLUDE_DIRS AND GCRYPT_LIBRARIES)
 
2
    set(GCRYPT_FOUND TRUE)
 
3
else (GCRYPT_INCLUDE_DIRS AND GCRYPT_LIBRARIES)
 
4
    find_path(GCRYPT_INCLUDE_DIRS
 
5
        NAMES
 
6
            gcrypt.h
 
7
        PATHS
 
8
            ${GCRYPT_PREFIX}/include
 
9
            /usr/include
 
10
            /usr/local/include
 
11
        NO_DEFAULT_PATH
 
12
    )
 
13
 
 
14
    find_library(GCRYPT_LIBRARIES
 
15
        NAMES
 
16
            gcrypt
 
17
        PATHS
 
18
            ${GCRYPT_PREFIX}/lib
 
19
            /usr/lib
 
20
            /usr/local/lib
 
21
        NO_DEFAULT_PATH
 
22
    )
 
23
    if(GCRYPT_INCLUDE_DIRS AND GCRYPT_LIBRARIES)
 
24
       set(GCRYPT_FOUND TRUE)
 
25
    endif(GCRYPT_INCLUDE_DIRS AND GCRYPT_LIBRARIES)
 
26
endif (GCRYPT_INCLUDE_DIRS AND GCRYPT_LIBRARIES)
 
27
 
 
28
if (GCRYPT_FOUND)
 
29
    message(STATUS "Found libgcrypt: includes ${GCRYPT_INCLUDE_DIRS} libs ${GCRYPT_LIBRARIES}")
 
30
else (GCRYPT_FOUND)
 
31
    if (GCrypt_FIND_REQUIRED)
 
32
        message(FATAL_ERROR "Could not find libgcrypt, try to setup GCRYPT_PREFIX accordingly")
 
33
    endif (GCrypt_FIND_REQUIRED)
 
34
endif (GCRYPT_FOUND)