CMake/Tests/RunCMake/configure_file/RerunCMake.cmake
Brad King 7f2dc8dc54 configure_file: Test that CMake re-runs on input change or output missing
With the Makefile generators we expect that touching or modifying the
input file of a configure_file, or removing its output, will cause CMake
to re-run on the next build.  Extend the RunCMake.configure_file test
with a case covering this.  Also check that CMake does not re-run if
nothing has changed.
2015-01-27 11:18:37 -05:00

9 lines
333 B
CMake

message("Running CMake on RerunCMake") # write to stderr if cmake reruns
configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in"
"${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt"
@ONLY
)
# make sure CMakeCache.txt is newer than ConfigureFileOutput.txt
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)