Crow/cmake/CrowConfig.cmake.in
Luca Schlecker 44f51f4750 Crow's current features (ssl and compression) can now be enabled through 'CROW_FEATURES' instead of their own CMake variables.
The default features are the ones Crow was installed with but can be overridden by setting 'CROW_FEATURES' before the 'find_package' call.

Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
2022-04-04 20:36:57 +02:00

44 lines
1.1 KiB
CMake

@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Boost 1.64 COMPONENTS system date_time)
find_dependency(Threads)
set(CROW_INSTALLED_FEATURES "@CROW_FEATURES@")
if(NOT DEFINED CROW_FEATURES)
set(CROW_FEATURES ${CROW_INSTALLED_FEATURES})
endif()
if("compression" IN_LIST CROW_FEATURES)
find_dependency(ZLIB)
endif()
if("ssl" IN_LIST CROW_FEATURES)
find_dependency(OpenSSL)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/CrowTargets.cmake")
check_required_components("@PROJECT_NAME@")
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" IN_LIST CROW_FEATURES)
list(APPEND _CROW_ILL "ZLIB::ZLIB")
list(APPEND _CROW_ICD "CROW_ENABLE_COMPRESSION")
endif()
if("ssl" IN_LIST 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}"
)