CMake: Use $<BUILD_INTERFACE:...> when referencing paths in build directory

This prevents CMake from including them in exported targets, which
allows the exported targets to be installed.
This commit is contained in:
Sam Edwards 2018-10-07 16:42:20 -06:00
parent 02412d0e7d
commit 086663ef4a
2 changed files with 3 additions and 3 deletions

View File

@ -87,8 +87,8 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE
${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES})
# Help other libraries find the autogenerated headers
target_include_directories(p3dtoolbase PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR})
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR}>)
target_link_libraries(p3dtoolbase PKG::EIGEN)
target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT})

View File

@ -72,7 +72,7 @@ composite_sources(p3prc P3PRC_SOURCES)
add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC
${P3PRC_HEADERS} ${P3PRC_SOURCES})
target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(p3prc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_link_libraries(p3prc p3dtool PKG::OPENSSL)
target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT})