diff options
author | Brad King <brad.king@kitware.com> | 2014-02-21 15:59:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-02-21 16:05:41 (GMT) |
commit | 73e5c6aead4d2c748ced061a7de27f2ffc7e2d31 (patch) | |
tree | 47c036f093ad4e4d5c334cbacb188f3316f6ee04 /Tests/BuildDepends/CMakeLists.txt | |
parent | c0bbefbfe7209e849c04f57e79908401ba825fe0 (diff) | |
download | CMake-73e5c6aead4d2c748ced061a7de27f2ffc7e2d31.zip CMake-73e5c6aead4d2c748ced061a7de27f2ffc7e2d31.tar.gz CMake-73e5c6aead4d2c748ced061a7de27f2ffc7e2d31.tar.bz2 |
ExternalProject: Add option to always run the build step
Teach ExternalProject_Add a new BUILD_ALWAYS option to skip using
the build step stamp file and execute the step on every build.
Extend the BuildDepends test with a case to cover this option.
Diffstat (limited to 'Tests/BuildDepends/CMakeLists.txt')
-rw-r--r-- | Tests/BuildDepends/CMakeLists.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 9727930..a875f07 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -68,6 +68,8 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h "#define link_depends_no_shared_exe_value 0\n") set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt) +file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n") + help_xcode_depends() message("Building project first time") @@ -166,6 +168,19 @@ else() "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.") endif() +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out) + file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out) + if("${external_out}" STREQUAL "external original") + message(STATUS "external.out contains '${external_out}'") + else() + message(SEND_ERROR "Project did not initially build properly: " + "external.out contains '${external_out}'") + endif() +else() + message(SEND_ERROR "Project did not initially build properly: " + "external.out is missing") +endif() + message("Waiting 3 seconds...") # any additional argument will cause ${bar} to wait forever execute_process(COMMAND ${bar} -infinite TIMEOUT 3 OUTPUT_VARIABLE out) @@ -191,6 +206,8 @@ if(TEST_LINK_DEPENDS) file(WRITE ${TEST_LINK_DEPENDS} "2") endif() +file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n") + help_xcode_depends() message("Building project second time") @@ -294,3 +311,16 @@ else() message(SEND_ERROR "Project did not rebuild properly. " "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.") endif() + +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out) + file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out) + if("${external_out}" STREQUAL "external changed") + message(STATUS "external.out contains '${external_out}'") + else() + message(SEND_ERROR "Project did not rebuild properly: " + "external.out contains '${external_out}'") + endif() +else() + message(SEND_ERROR "Project did not rebuild properly: " + "external.out is missing") +endif() |