Files
CMake/Tests/RunCMake/add_custom_command/ConfigureFile.cmake
Brad King 0d1529000d VS: Revert "Add CMake input files to ZERO_CHECK"
Since commit df58dbb0e9 (VS: Add CMake input files to ZERO_CHECK,
2023-03-19, v3.27.0-rc1~157^2), projects that specify the same file both
as input to `configure_file` and as the `MAIN_DEPENDENCY` of a custom
command fail to configure.  Revert the change pending further
investigation.  Add a test case demonstrating the problem.

Issue: #24557
Fixes: #25149
2023-08-02 11:53:48 -04:00

10 lines
286 B
CMake

configure_file(ConfigureFile.in foo.txt @ONLY)
add_custom_target(foo)
add_custom_command(
OUTPUT bar.txt
MAIN_DEPENDENCY ConfigureFile.in # Attach to input of configure_file
DEPENDS foo
COMMAND ${CMAKE_COMMAND} -E copy foo.txt bar.txt
)
add_custom_target(bar DEPENDS bar.txt)