Add CMake installation rules (#2184)

Add installation rules for all the binary targets.

Targets are installed under `<CMAKE_INSTALL_PREFIX>/bin/<CONFIG>` where
`<CONFIG>` is `CMAKE_BUILD_TYPE` for single-config generators, e.g. Unix
Makefiles and Ninja, or the build configuration for multi-config
generators, e.g. Ninja Multi-Config and Visual Studio.

This creates the target `install` on Unix and `INSTALL` on Windows.
This commit is contained in:
Ahmed Hesham
2025-02-19 04:47:56 +00:00
committed by GitHub
parent 9216c81855
commit 485964d87c
4 changed files with 26 additions and 0 deletions

View File

@@ -7,3 +7,8 @@ add_executable(${${MODULE_NAME}_OUT} ${${MODULE_NAME}_SOURCES})
set_property(TARGET ${${MODULE_NAME}_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") set_property(TARGET ${${MODULE_NAME}_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}")
TARGET_LINK_LIBRARIES(${${MODULE_NAME}_OUT} ${HARNESS_LIB} ${CLConform_LIBRARIES}) TARGET_LINK_LIBRARIES(${${MODULE_NAME}_OUT} ${HARNESS_LIB} ${CLConform_LIBRARIES})
include(GNUInstallDirs)
install(TARGETS ${${MODULE_NAME}_OUT}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/$<CONFIG>)

View File

@@ -31,3 +31,10 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E copy_directory COMMAND ${CMAKE_COMMAND} -E copy_directory
${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory ${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory
${COMPILER_TEST_RESOURCES}/secondIncludeTestDirectory) ${COMPILER_TEST_RESOURCES}/secondIncludeTestDirectory)
include(GNUInstallDirs)
install(DIRECTORY
${CLConform_SOURCE_DIR}/test_conformance/compiler/includeTestDirectory
${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory
DESTINATION ${CMAKE_INSTALL_BINDIR}/$<CONFIG>)

View File

@@ -500,3 +500,10 @@ add_custom_command(
VERBATIM) VERBATIM)
add_custom_target(spirv_new_binaries DEPENDS ${assembled_spirv_binaries}) add_custom_target(spirv_new_binaries DEPENDS ${assembled_spirv_binaries})
include(GNUInstallDirs)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/../spirv_bin
DESTINATION
${CMAKE_INSTALL_BINDIR}/$<CONFIG>)

View File

@@ -44,4 +44,11 @@ else()
endforeach() endforeach()
add_custom_target(vulkan_shaders DEPENDS ${vulkan_spirv_files}) add_custom_target(vulkan_shaders DEPENDS ${vulkan_spirv_files})
include(GNUInstallDirs)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
DESTINATION
${CMAKE_INSTALL_BINDIR}/$<CONFIG>)
endif() endif()