diff options
author | Brad King <brad.king@kitware.com> | 2020-02-17 15:25:57 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-02-17 15:26:05 (GMT) |
commit | b782fc9390a82dc23de12b5cefbf9aa3af489365 (patch) | |
tree | 5b3527944644d4e7749489a0a8c15a7dc3410bac /Tests | |
parent | 6d00a2de7b019b17bd9735108c1e80c2031f345a (diff) | |
parent | e46e3442fdea8297d27d765a77d48176cf50a83b (diff) | |
download | CMake-b782fc9390a82dc23de12b5cefbf9aa3af489365.zip CMake-b782fc9390a82dc23de12b5cefbf9aa3af489365.tar.gz CMake-b782fc9390a82dc23de12b5cefbf9aa3af489365.tar.bz2 |
Merge topic 'makefiles-deep-configure'
e46e3442fd Makefiles: Re-run CMake if file configured in subdirectory is missing
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4359
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/configure_file/RerunCMake.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/configure_file/RunCMakeTest.cmake | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake index 890cc1f..98387d0 100644 --- a/Tests/RunCMake/configure_file/RerunCMake.cmake +++ b/Tests/RunCMake/configure_file/RerunCMake.cmake @@ -1,8 +1,4 @@ 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 - ) +add_subdirectory(RerunCMake) # make sure CMakeCache.txt is newer than ConfigureFileOutput.txt execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) diff --git a/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt b/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt new file mode 100644 index 0000000..c9681c7 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt @@ -0,0 +1,5 @@ +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" + @ONLY + ) diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index de14468..32a0770 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -22,7 +22,7 @@ if(RunCMake_GENERATOR MATCHES "Make") set(RunCMake_TEST_NO_CLEAN 1) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") + set(in_conf "${RunCMake_TEST_BINARY_DIR}/RerunCMake/ConfigureFileInput.txt.in") file(WRITE "${in_conf}" "1") message(STATUS "RerunCMake: first configuration...") @@ -42,7 +42,7 @@ if(RunCMake_GENERATOR MATCHES "Make") run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) message(STATUS "RerunCMake: remove configure_file output...") - file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") + file(REMOVE "${RunCMake_TEST_BINARY_DIR}/RerunCMake/ConfigureFileOutput.txt") run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) |