Handle install vs build include directories

Fix target_include_directories to appropriately handle build-tree and the install-tree.
This commit is contained in:
James Rumble
2019-08-06 15:29:31 +01:00
parent ab6d1499e1
commit c6f7294ced
8 changed files with 23 additions and 15 deletions

View File

@@ -33,7 +33,9 @@ endif(WIN32)
target_link_libraries(glslangValidator ${LIBRARIES})
target_link_libraries(spirv-remap ${LIBRARIES})
target_include_directories(glslangValidator PUBLIC ../External)
target_include_directories(glslangValidator PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
if(WIN32)
source_group("Source" FILES ${SOURCES})
@@ -46,12 +48,12 @@ if(ENABLE_GLSLANG_INSTALL)
install(TARGETS spirv-remap EXPORT spirv-remapTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(EXPORT glslangValidatorTargets DESTINATION ${LIB_INSTALL_DIR}/cmake)
install(EXPORT spirv-remapTargets DESTINATION ${LIB_INSTALL_DIR}/cmake)
install(EXPORT glslangValidatorTargets DESTINATION lib/cmake)
install(EXPORT spirv-remapTargets DESTINATION lib/cmake)
if(BUILD_SHARED_LIBS)
install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${LIB_INSTALL_DIR}/cmake)
install(EXPORT glslang-default-resource-limitsTargets DESTINATION lib/cmake)
endif()
endif(ENABLE_GLSLANG_INSTALL)