-
Notifications
You must be signed in to change notification settings - Fork 1
/
CrowConfig.cmake
69 lines (53 loc) · 2.1 KB
/
CrowConfig.cmake
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
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was CrowConfig.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
include(CMakeFindDependencyMacro)
find_dependency(Boost 1.64 COMPONENTS system date_time)
find_dependency(Threads)
set(CROW_INSTALLED_FEATURES "OFF")
if(NOT DEFINED CROW_FEATURES)
set(CROW_FEATURES ${CROW_INSTALLED_FEATURES})
endif()
if("compression" MATCHES ${CROW_FEATURES})
message(STATUS "In compresses include dir: ${CROW_FEATURES}")
find_dependency(ZLIB)
endif()
if("ssl" MATCHES ${CROW_FEATURES})
message(STATUS "In ssl include dir: ${CROW_FEATURES}")
find_dependency(OpenSSL)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/CrowTargets.cmake")
check_required_components("Crow")
get_target_property(_CROW_ILL Crow::Crow INTERFACE_LINK_LIBRARIES)
get_target_property(_CROW_ICD Crow::Crow INTERFACE_COMPILE_DEFINITIONS)
list(REMOVE_ITEM _CROW_ILL "ZLIB::ZLIB" "OpenSSL::SSL")
list(REMOVE_ITEM _CROW_ICD "CROW_ENABLE_SSL" "CROW_ENABLE_COMPRESSION")
if("compression" MATCHES ${CROW_FEATURES})
list(APPEND _CROW_ILL "ZLIB::ZLIB")
list(APPEND _CROW_ICD "CROW_ENABLE_COMPRESSION")
endif()
if("ssl" MATCHES ${CROW_FEATURES})
list(APPEND _CROW_ILL "OpenSSL::SSL")
list(APPEND _CROW_ICD "CROW_ENABLE_SSL")
endif()
set_target_properties(Crow::Crow PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${_CROW_ICD}"
INTERFACE_LINK_LIBRARIES "${_CROW_ILL}"
)