File: FindBotan.cmake

package info (click to toggle)
corectrl 1.5.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,644 kB
  • sloc: cpp: 42,650; ansic: 174; javascript: 158; makefile: 18; sh: 3
file content (53 lines) | stat: -rw-r--r-- 1,642 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# - Find botan
# Find the botan cryptographic library
#
# This module defines the following variables:
#   Botan_FOUND  -  True if library and include directory are found
# If set to TRUE, the following are also defined:
#   Botan_INCLUDE_DIRS  -  The directory where to find the header file
#   Botan_LIBRARIES  -  Where to find the library file
#
# For convenience, these variables are also set. They have the same values
# than the variables above.  The user can thus choose his/her preferred way
# to write them.
#   Botan_LIBRARY
#   Botan_INCLUDE_DIR
#
# This file is in the public domain

find_package(PkgConfig REQUIRED)

macro(FIND_BOTAN_IN_FS BOTAN_VER)
  find_path(Botan_INCLUDE_DIRS NAMES botan/types.h
      PATH_SUFFIXES ${BOTAN_VER}
      DOC "The botan include directory")

  find_library(Botan_LIBRARIES NAMES botan ${BOTAN_VER}
      DOC "The botan library")

  # Use some standard module to handle the QUIETLY and REQUIRED arguments, and
  # set Botan_FOUND to TRUE if these two variables are set.
  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(Botan REQUIRED_VARS Botan_LIBRARIES Botan_INCLUDE_DIRS)

  if(Botan_FOUND)
    set(Botan_LIBRARY ${Botan_LIBRARIES} CACHE INTERNAL "")
    set(Botan_INCLUDE_DIR ${Botan_INCLUDE_DIRS} CACHE INTERNAL "")
    set(Botan_FOUND ${Botan_FOUND} CACHE INTERNAL "")
  endif()
endmacro()

pkg_check_modules(Botan botan-3)
if(NOT Botan_FOUND)
  find_botan_in_fs(botan-3)
endif()

if(NOT Botan_FOUND)
  pkg_check_modules(Botan botan-2)

  if(NOT Botan_FOUND)
    find_botan_in_fs(botan-2)
  endif()
endif()

mark_as_advanced(Botan_INCLUDE_DIRS Botan_LIBRARIES)