summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/Configure/RerunCMake.cmake
blob: c0b07981960809ae0d93b32758f4c4aada0fb125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)

set(error  ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeError.txt)
if(EXISTS ${error})
  file(READ ${error} content)
  message(FATAL_ERROR "Rerun error ${content}")
endif()