mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-16 11:40:25 -06:00
For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
21 lines
707 B
CMake
21 lines
707 B
CMake
cmake_policy(SET CMP0118 NEW)
|
|
enable_language(C)
|
|
|
|
set_source_files_properties(
|
|
"${CMAKE_CURRENT_BINARY_DIR}/target.c"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/target-no-depends.c"
|
|
PROPERTIES GENERATED 1)
|
|
|
|
add_executable(working
|
|
"${CMAKE_CURRENT_BINARY_DIR}/target.c"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/target-no-depends.c")
|
|
|
|
add_custom_target(
|
|
gen-target.c ALL
|
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/dep.c" "${CMAKE_CURRENT_BINARY_DIR}/target.c")
|
|
add_custom_target(
|
|
gen-target-no-depends.c ALL
|
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/dep.c" "${CMAKE_CURRENT_BINARY_DIR}/target-no-depends.c")
|
|
|
|
add_dependencies(working gen-target.c)
|