Files
OpenCL-CTS/test_conformance/compiler/CMakeLists.txt
Ahmed Hesham 485964d87c 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.
2025-02-18 20:47:56 -08:00

41 lines
1.4 KiB
CMake

set(MODULE_NAME COMPILER)
set(${MODULE_NAME}_SOURCES
main.cpp
test_build_helpers.cpp
test_compile.cpp
test_async_build.cpp
test_build_options.cpp
test_preprocessor.cpp
test_opencl_c_versions.cpp
test_image_macro.cpp
test_compiler_defines_for_extensions.cpp
test_pragma_unroll.cpp
test_unload_platform_compiler.cpp
test_feature_macro.cpp
)
include(../CMakeCommon.txt)
# Copy the required test include directories into the build directory.
if(NOT DEFINED COMPILER_TEST_RESOURCES)
set(COMPILER_TEST_RESOURCES $<TARGET_FILE_DIR:${${MODULE_NAME}_OUT}>)
endif()
add_custom_command(
COMMENT "Copying compiler test resources..."
TARGET ${${MODULE_NAME}_OUT}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CLConform_SOURCE_DIR}/test_conformance/compiler/includeTestDirectory
${COMPILER_TEST_RESOURCES}/includeTestDirectory
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CLConform_SOURCE_DIR}/test_conformance/compiler/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>)