Add Beast INTERFACE CMake target

This commit is contained in:
Sacha
2017-06-13 08:52:14 -07:00
committed by Vinnie Falco
parent 9939320c83
commit 1037c5bfba
2 changed files with 20 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ Version 56:
* Try harder to find Boost (cmake)
* Reset error codes
* More basic_parser tests
* Add an INTERFACE cmake target
--------------------------------------------------------------------------------

View File

@@ -2,7 +2,7 @@
cmake_minimum_required (VERSION 3.5.2)
project (Beast)
project (Beast VERSION 56)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
@@ -129,6 +129,24 @@ elseif ("${VARIANT}" STREQUAL "release")
endif()
#-------------------------------------------------------------------------------
#
# Library interface
#
add_library(${PROJECT_NAME} INTERFACE)
target_link_libraries(${PROJECT_NAME} INTERFACE ${Boost_SYSTEM_LIBRARY})
if (NOT MSVC)
target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads)
endif()
target_include_directories(${PROJECT_NAME} INTERFACE ${Boost_INCLUDE_DIRS})
target_compile_definitions(${PROJECT_NAME} INTERFACE BOOST_COROUTINES_NO_DEPRECATION_WARNING=1)
#-------------------------------------------------------------------------------
#
# Tests and examples
#
include_directories (.)
include_directories (extras)
include_directories (include)