1 cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
2 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
6 include (FeatureSummary)
7 find_package (ARPA2CM 0.5 QUIET NO_MODULE)
8 set_package_properties (ARPA2CM PROPERTIES
9 DESCRIPTION "CMake modules for ARPA2 projects"
11 URL "https://github.com/arpa2/arpa2cm/"
12 PURPOSE "Required for the CMake build system for ${PROJECT}"
15 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARPA2CM_MODULE_PATH})
17 feature_summary (WHAT ALL)
18 message (FATAL_ERROR "ARPA2CM is required.")
21 include(MacroEnsureOutOfSourceBuild)
22 include(MacroGitVersionInfo)
25 include(FeatureSummary)
26 include(GNUInstallDirs)
28 set(CMAKE_C_STANDARD 99)
29 set(CMAKE_C_STANDARD_REQUIRED ON)
31 macro_ensure_out_of_source_build(
32 "Do not build TLSPool in the source directory.")
33 get_version_from_git(TLSPool 0.20)
35 # Finding dependencies, find-modules provided by:
36 # - "ARPA" is shipped with ARPA2CM
37 # - "Module" is shipped with CMake itself
38 # - "Config" is shipped with that software package
40 find_package(BDB REQUIRED) # ARPA
41 find_package(GnuTLS REQUIRED) # Module
42 find_package(GnuTLSDane REQUIRED) # ARPA
43 find_package(KERBEROS REQUIRED) # Local
44 find_package(Libldns REQUIRED) # ARPA
45 find_package(LibTASN1 REQUIRED) # ARPA
46 find_package(OpenLDAP REQUIRED) # ARPA
47 find_package(P11-Kit REQUIRED) # ARPA
48 find_package(Quick-DER 1.2.4 REQUIRED NO_MODULE) # Config
49 find_package(Unbound REQUIRED) # ARPA
51 # TODO: look for TLS-KDH
54 add_definitions(-DHAVE_GNUTLS_DANE)
58 feature_summary(WHAT ALL VAR _features)
59 message(STATUS ${_features})
61 option(EXPERIMENTAL_SRP_SUPPORT "Enable support for SRP based on relative file names" OFF)
62 if (EXPERIMENTAL_SRP_SUPPORT)
63 add_definitions(-DEXPERIMENTAL_SRP)
66 # These are compile flags, not definitions, but it happens to work.
67 add_definitions(-fPIC -pthread)
68 # Pretend we looked for pthread libraries, so that we can write
69 # cmake code that looks consistent.
70 set(pthread_LIBRARIES pthread)
71 # Always include the TLSPool top-level include/ dir.
72 include_directories(${CMAKE_SOURCE_DIR}/include)
78 add_subdirectory(tool)
79 add_subdirectory(pulleyback)
82 add_subdirectory(test)