Add exported CMake config file for binaries in ./tools/ (#5034)
The package is called SPIRV-Tools-tools, which might be a bit confusing, but at lease follows the general naming scheme.
This commit is contained in:
Родитель
bbdd0fefda
Коммит
077b09c32a
|
@ -69,6 +69,22 @@ if (NOT ${SPIRV_SKIP_EXECUTABLES})
|
||||||
endif(SPIRV_BUILD_FUZZER)
|
endif(SPIRV_BUILD_FUZZER)
|
||||||
|
|
||||||
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
||||||
install(TARGETS ${SPIRV_INSTALL_TARGETS} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS ${SPIRV_INSTALL_TARGETS} EXPORT SPIRV-Tools-toolsTargets
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
export(EXPORT SPIRV-Tools-toolsTargets FILE SPIRV-Tools-toolsTargets.cmake)
|
||||||
|
|
||||||
|
spvtools_config_package_dir(SPIRV-Tools-tools PACKAGE_DIR)
|
||||||
|
install(EXPORT SPIRV-Tools-toolsTargets FILE SPIRV-Tools-toolsTargets.cmake
|
||||||
|
DESTINATION ${PACKAGE_DIR})
|
||||||
|
|
||||||
|
file(WRITE ${CMAKE_BINARY_DIR}/SPIRV-Tools-toolsConfig.cmake
|
||||||
|
"include(CMakeFindDependencyMacro)\n"
|
||||||
|
"find_dependency(${SPIRV_TOOLS})\n"
|
||||||
|
"include(\${CMAKE_CURRENT_LIST_DIR}/SPIRV-Tools-toolsTargets.cmake)\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-toolsConfig.cmake DESTINATION ${PACKAGE_DIR})
|
||||||
endif(ENABLE_SPIRV_TOOLS_INSTALL)
|
endif(ENABLE_SPIRV_TOOLS_INSTALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче