forked from djarek/certify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (65 loc) · 2.12 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
cmake_minimum_required(VERSION 3.8)
project(certify VERSION 0.1 LANGUAGES CXX)
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/CMakeModules)
if (CMAKE_VERSION VERSION_LESS 3.11)
# Latest FindBoost.cmake has likely been updated to detect Boost version not yet released
if (NOT EXISTS "${CMAKE_BINARY_DIR}/cmake/FindBoost.cmake")
message(STATUS "Downloading FindBoost.cmake from https://gitlab.kitware.com/cmake/ release branch")
file(
DOWNLOAD
"https://gitlab.kitware.com/cmake/cmake/raw/release/Modules/FindBoost.cmake"
"${CMAKE_BINARY_DIR}/cmake/FindBoost.cmake")
endif()
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR}/cmake)
endif()
find_package(Boost 1.67
COMPONENTS
system
filesystem
date_time
unit_test_framework
REQUIRED)
find_package (Threads)
find_package(OpenSSL REQUIRED)
add_library(core INTERFACE)
add_library(certify::core ALIAS core)
target_compile_features(core INTERFACE cxx_std_11)
target_include_directories(core INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
if(MSVC)
target_link_libraries(core INTERFACE Crypt32.lib)
endif()
target_link_libraries(
core
INTERFACE
Boost::system
Boost::filesystem
Boost::date_time
Threads::Threads
OpenSSL::SSL
OpenSSL::Crypto)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"certifyConfigVersion.cmake"
COMPATIBILITY AnyNewerVersion)
install(FILES
"netutilsConfig.cmake"
"${CMAKE_BINARY_DIR}/certifyConfigVersion.cmake"
DESTINATION lib/cmake/certify)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION include
FILES_MATCHING PATTERN "*.hpp")
install(TARGETS core
EXPORT certifyTargets
INCLUDES DESTINATION include)
install(EXPORT certifyTargets
FILE certifyTargets.cmake
NAMESPACE certify::
DESTINATION lib/cmake/certify)
include(CTest)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()