Use system includes for asio and if used as subdirectory
This commit is contained in:
parent
fff70e5231
commit
ee1a69ba4a
1 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue