File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,9 +116,10 @@ if(VERBOSE)
116116 message (STATUS "contrib_private_headers: ${contrib_private_headers} " )
117117endif ()
118118
119- include_directories (${YAML_CPP_SOURCE_DIR} /src )
120- include_directories (${YAML_CPP_SOURCE_DIR} /include )
121-
119+ if (CMAKE_VERSION VERSION_LESS 2.8.12)
120+ include_directories (${YAML_CPP_SOURCE_DIR} /src )
121+ include_directories (${YAML_CPP_SOURCE_DIR} /include )
122+ endif ()
122123
123124
124125###
@@ -275,6 +276,14 @@ set(_INSTALL_DESTINATIONS
275276### Library
276277###
277278add_library (yaml-cpp ${library_sources} )
279+
280+ if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
281+ target_include_directories (yaml-cpp
282+ PUBLIC $<BUILD_INTERFACE :${YAML_CPP_SOURCE_DIR} /include >
283+ $<INSTALL_INTERFACE :${INCLUDE_INSTALL_ROOT_DIR} >
284+ PRIVATE $<BUILD_INTERFACE :${YAML_CPP_SOURCE_DIR} /src >)
285+ endif ()
286+
278287set_target_properties (yaml-cpp PROPERTIES
279288 COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags} "
280289)
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ file(GLOB test_new_api_sources new-api/[a-z]*.cpp)
3030list (APPEND test_sources ${test_new_api_sources} )
3131add_sources (${test_sources} ${test_headers} )
3232
33+ include_directories (${YAML_CPP_SOURCE_DIR} /src )
3334include_directories (${YAML_CPP_SOURCE_DIR} /test )
3435
3536add_executable (run-tests
You can’t perform that action at this time.
0 commit comments