diff --git a/CHANGELOG.md b/CHANGELOG.md index c21cf6ba..a814a331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Version 56: * Try harder to find Boost (cmake) * Reset error codes * More basic_parser tests +* Add an INTERFACE cmake target -------------------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 19cf2820..6028e2cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)