diff --git a/CMakeLists.txt b/CMakeLists.txt index 08672e8..376bc7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,11 @@ option(USE_OPENSSL "set OFF to build without OpenSSL" ON) add_library(simple-web-server INTERFACE) -target_include_directories(simple-web-server INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + target_include_directories(simple-web-server INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +else() + target_include_directories(simple-web-server SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +endif() find_package(Threads REQUIRED) target_link_libraries(simple-web-server INTERFACE Threads::Threads) @@ -24,7 +28,7 @@ if(USE_STANDALONE_ASIO) if(NOT ASIO_PATH) message(FATAL_ERROR "Standalone Asio not found") else() - target_include_directories(simple-web-server INTERFACE ${ASIO_PATH}) + target_include_directories(simple-web-server SYSTEM INTERFACE ${ASIO_PATH}) endif() else() find_package(Boost 1.53.0 COMPONENTS system thread REQUIRED)