diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d8e0c7..84bb0f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.5) project(mstch) option(WITH_UNIT_TESTS "enable building unit test executable" OFF) option(WITH_BENCHMARK "enable building benchmark executable" OFF) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) set(CMAKE_BUILD_TYPE Release) set(mstch_VERSION 1.0.1) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6517fc4..ce3715c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,11 +1,9 @@ find_package(Boost 1.54 REQUIRED) -set(mstch_INCLUDE_DIR - ${PROJECT_SOURCE_DIR}/include CACHE STRING "mstch include directory") - -include_directories( - ${mstch_INCLUDE_DIR} - ${Boost_INCLUDE_DIR}) +# Define headers for this library. PUBLIC headers are used for compiling +# the library, and will be added to consumers' build paths. +set(BUILD_INCLUDE $) +set(INSTALL_INCLUDE $) set(SRC state/in_section.cpp @@ -25,6 +23,11 @@ set(SRC add_library(mstch STATIC ${SRC}) set_property(TARGET mstch PROPERTY VERSION ${mstch_VERSION}) +target_include_directories(mstch PUBLIC + ${BUILD_INCLUDE} + ${INSTALL_INCLUDE} + PRIVATE .) +target_link_libraries(mstch Boost::boost) install( TARGETS mstch EXPORT mstchTargets