diff --git a/CMakeLists.txt b/CMakeLists.txt index a00958f..58e7dd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,6 @@ target_include_directories(simple-web-server INTERFACE ${CMAKE_CURRENT_SOURCE_DI find_package(Threads REQUIRED) target_link_libraries(simple-web-server INTERFACE Threads::Threads) -# TODO 2020 when Debian Jessie LTS ends: -# Remove Boost system, thread, regex components; use Boost:: aliases; remove Boost target_include_directories if(USE_STANDALONE_ASIO) target_compile_definitions(simple-web-server INTERFACE ASIO_STANDALONE) find_path(ASIO_PATH asio.hpp) @@ -30,13 +28,11 @@ if(USE_STANDALONE_ASIO) endif() else() find_package(Boost 1.53.0 COMPONENTS system thread REQUIRED) - target_link_libraries(simple-web-server INTERFACE ${Boost_LIBRARIES}) - target_include_directories(simple-web-server INTERFACE ${Boost_INCLUDE_DIR}) + target_link_libraries(simple-web-server INTERFACE Boost::boost Boost::system Boost::thread) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) target_compile_definitions(simple-web-server INTERFACE USE_BOOST_REGEX) find_package(Boost 1.53.0 COMPONENTS regex REQUIRED) - target_link_libraries(simple-web-server INTERFACE ${Boost_LIBRARIES}) - target_include_directories(simple-web-server INTERFACE ${Boost_INCLUDE_DIR}) + target_link_libraries(simple-web-server INTERFACE Boost::regex) endif() endif() if(WIN32) @@ -74,13 +70,11 @@ if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") if(Boost_FOUND) add_executable(http_examples http_examples.cpp) target_link_libraries(http_examples simple-web-server) - target_link_libraries(http_examples ${Boost_LIBRARIES}) - target_include_directories(http_examples PRIVATE ${Boost_INCLUDE_DIR}) + target_link_libraries(http_examples Boost::boost Boost::system Boost::thread Boost::filesystem) if(OPENSSL_FOUND) add_executable(https_examples https_examples.cpp) target_link_libraries(https_examples simple-web-server) - target_link_libraries(https_examples ${Boost_LIBRARIES}) - target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR}) + target_link_libraries(https_examples Boost::boost Boost::system Boost::thread Boost::filesystem) endif() endif()