82d4317503
Define a new 'CMAKE_CONFIGURE_DEPENDS' directory property that projects can use to specify input files to the CMake configuration process. Extend the RunCMake.Configure test to verify that the build system re-runs CMake when this input changes.
12 lines
526 B
CMake
12 lines
526 B
CMake
set(input ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeInput.txt)
|
|
set(stamp ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeStamp.txt)
|
|
file(READ ${input} content)
|
|
file(WRITE ${stamp} "${content}")
|
|
|
|
set(depend ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeDepend.txt)
|
|
set(output ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeOutput.txt)
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${depend})
|
|
file(READ ${depend} content)
|
|
file(WRITE ${output} "${content}")
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS RerunCMake.txt)
|