-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
110 lines (90 loc) · 3.4 KB
/
CMakeLists.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
message(FATAL_ERROR "This repository has moved to GitLab\n\nGet TLSPool from\n\thttps://gitlab.com/arpa2/tlspool/\n")
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
project(tlspool C)
include (FeatureSummary)
find_package (ARPA2CM 0.5 QUIET NO_MODULE)
set_package_properties (ARPA2CM PROPERTIES
DESCRIPTION "CMake modules for ARPA2 projects"
TYPE REQUIRED
URL "https://github.com/arpa2/arpa2cm/"
PURPOSE "Required for the CMake build system for ${PROJECT}"
)
if (ARPA2CM_FOUND)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARPA2CM_MODULE_PATH})
else()
feature_summary (WHAT ALL)
message (FATAL_ERROR "ARPA2CM is required.")
endif()
include(MacroEnsureOutOfSourceBuild)
include(MacroGitVersionInfo)
include(CTest)
include(FeatureSummary)
include(GNUInstallDirs)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
macro_ensure_out_of_source_build(
"Do not build TLSPool in the source directory.")
get_version_from_git(TLSPool 0.20)
# Finding dependencies, find-modules provided by:
# - "ARPA" is shipped with ARPA2CM
# - "Module" is shipped with CMake itself
# - "Config" is shipped with that software package
#
find_package(BDB REQUIRED) # ARPA
find_package(GnuTLS REQUIRED) # Module
find_package(GnuTLSDane REQUIRED) # ARPA
find_package(KERBEROS REQUIRED) # Local
find_package(Libldns REQUIRED) # ARPA
find_package(LibTASN1 REQUIRED) # ARPA
find_package(OpenLDAP REQUIRED) # ARPA
find_package(P11-Kit REQUIRED) # ARPA
find_package(Quick-DER 1.2.4 REQUIRED NO_MODULE) # Config
find_package(Unbound REQUIRED) # ARPA
find_package(com_err REQUIRED) # Local
# TODO: look for TLS-KDH
if(GnuTLSDane_FOUND)
add_definitions(-DHAVE_GNUTLS_DANE)
endif()
feature_summary(WHAT ALL VAR _features)
message(STATUS ${_features})
option(DEBUG "Produce debugging output (for developers)" OFF)
option(TEST_UNDER_TLSPOOL "Test under the assumption of an available TLS Pool" OFF)
option(EXPERIMENTAL_SRP_SUPPORT "Enable support for SRP based on relative file names" OFF)
if (EXPERIMENTAL_SRP_SUPPORT)
add_definitions(-DEXPERIMENTAL_SRP)
endif()
option(EXPERIMENTAL_LIBEV "Experiment with libev as a event backend" OFF)
# Constrain the acceptable STARTTLS driver names
# to those that are supported in our source code
# set_property (CACHE STARTTLS_DRIVER PROPERTY STRINGS gnutls openssl mbedtls)
if (NOT STARTTLS_DRIVER)
if (GnuTLS_FOUND)
set (STARTTLS_DRIVER gnutls CACHE STRING "Select the driving software for the STARTTLS feature")
endif()
endif()
if (NOT STARTTLS_DRIVER)
# For now, require a STARTTLS_DRIVER choice
# Later, consider using it to select available features (see PIOC_PING_V2)
message (FATAL_ERROR "You need _some_ driver for STARTTLS")
endif()
set_property (CACHE STARTTLS_DRIVER PROPERTY STRINGS gnutls)
# These are compile flags, not definitions, but it happens to work.
add_definitions(-fPIC -pthread)
if (DEBUG)
add_definitions (-ggdb3 -O0)
endif()
# Pretend we looked for pthread libraries, so that we can write
# cmake code that looks consistent.
set(pthread_LIBRARIES pthread)
# Always include the TLSPool top-level include/ dir.
include_directories(${CMAKE_SOURCE_DIR}/include)
enable_testing()
add_subdirectory(src)
add_subdirectory(lib)
add_subdirectory(tool)
add_subdirectory(pulleyback)
add_subdirectory(doc)
if(BUILD_TESTING)
add_subdirectory(test)
endif()