cmake: properly include asio.

This commit is contained in:
Luca Schlecker 2022-06-06 18:52:43 +02:00 committed by Farook Al-Sammarraie
parent 4aa9b3e89b
commit 649e9c46ff
2 changed files with 11 additions and 3 deletions

View File

@ -52,14 +52,17 @@ target_include_directories(Crow
$<INSTALL_INTERFACE:include>
)
find_package(asio REQUIRED)
find_path(ASIO_INCLUDE_DIR asio.hpp REQUIRED)
find_package(Threads REQUIRED)
target_link_libraries(Crow
INTERFACE
asio::asio
Threads::Threads
)
target_include_directories(Crow
INTERFACE
${ASIO_INCLUDE_DIR}
)
if("compression" IN_LIST CROW_FEATURES)
find_package(ZLIB REQUIRED)

View File

@ -1,7 +1,7 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(asio)
find_path(ASIO_INCLUDE_DIR asio.hpp REQUIRED)
find_dependency(Threads)
set(CROW_INSTALLED_FEATURES "@CROW_FEATURES@")
@ -41,3 +41,8 @@ set_target_properties(Crow::Crow PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${_CROW_ICD}"
INTERFACE_LINK_LIBRARIES "${_CROW_ILL}"
)
target_include_directories(Crow::Crow
INTERFACE
${ASIO_INCLUDE_DIR}
)