Export glslang targets on installation

This allows the targets to be used in other cmake projects. See the following for more details:
https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-packages
https://foonathan.net/blog/2016/07/07/cmake-dependency-handling.html
This commit is contained in:
James Rumble
2019-08-06 14:47:51 +01:00
parent 3cea2e5882
commit ab6d1499e1
8 changed files with 28 additions and 15 deletions

View File

@@ -33,12 +33,13 @@ endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
if(BUILD_SHARED_LIBS)
install(TARGETS HLSL
install(TARGETS HLSL EXPORT HLSLTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
install(TARGETS HLSL
install(TARGETS HLSL EXPORT HLSLTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(EXPORT HLSLTargets DESTINATION ${LIB_INSTALL_DIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)