diff options
Diffstat (limited to 'Tests/RunCMake/ExternalProject/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/ExternalProject/RunCMakeTest.cmake | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake index 598671f..22b8d24 100644 --- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake @@ -151,3 +151,33 @@ endif() if(doSubstitutionTest) __ep_test_with_build(Substitutions) endif() + +function(__ep_test_CONFIGURE_HANDLED_BY_BUILD) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CONFIGURE_HANDLED_BY_BUILD-build) + run_cmake(CONFIGURE_HANDLED_BY_BUILD) + + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(BUILD_CONFIG --config Debug) + set(STAMP_DIR "${RunCMake_TEST_BINARY_DIR}/stamp/Debug") + else() + set(BUILD_CONFIG "") + set(STAMP_DIR "${RunCMake_TEST_BINARY_DIR}/stamp") + endif() + + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(CONFIGURE_HANDLED_BY_BUILD-build ${CMAKE_COMMAND} --build . ${BUILD_CONFIG}) + + # Calculate timestamps before rebuilding so we can compare before and after in + # CONFIGURE_HANDLED_BY_BUILD-rebuild-check.cmake + + file(TIMESTAMP "${STAMP_DIR}/proj1-configure" PROJ1_CONFIGURE_TIMESTAMP_BEFORE "%s") + # When BUILD_ALWAYS is set, the build stamp is never created. + file(TIMESTAMP "${STAMP_DIR}/proj2-configure" PROJ2_CONFIGURE_TIMESTAMP_BEFORE "%s") + file(TIMESTAMP "${STAMP_DIR}/proj2-build" PROJ2_BUILD_TIMESTAMP_BEFORE "%s") + + run_cmake_command(CONFIGURE_HANDLED_BY_BUILD-rebuild ${CMAKE_COMMAND} --build . ${BUILD_CONFIG}) +endfunction() + +if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 9 ") + __ep_test_CONFIGURE_HANDLED_BY_BUILD() +endif() |