summaryrefslogtreecommitdiffstats
path: root/Tests/BuildDepends/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-21 17:22:12 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-21 17:22:12 (GMT)
commitd83b4cd255bcd13b5b7e4279a6e3e959fcb58688 (patch)
tree1987a83567e98da043994e7fa870fe48c7b08c8a /Tests/BuildDepends/CMakeLists.txt
parent6586149d64be27694652b40bfbcc4d19f6c2c5eb (diff)
downloadCMake-d83b4cd255bcd13b5b7e4279a6e3e959fcb58688.zip
CMake-d83b4cd255bcd13b5b7e4279a6e3e959fcb58688.tar.gz
CMake-d83b4cd255bcd13b5b7e4279a6e3e959fcb58688.tar.bz2
ENH: Add a depends check step to custom targets. Add support for the IMPLICIT_DEPENDS feature of custom commands when building in custom targets. Convert multiple-output pair checks to be per-target instead of global.
Diffstat (limited to 'Tests/BuildDepends/CMakeLists.txt')
-rw-r--r--Tests/BuildDepends/CMakeLists.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 428d5ed..90b6b92 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -13,6 +13,8 @@ write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in
"static const char* zot = \"zot\";\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_custom.hxx.in
+ "static const char* zot_custom = \"zot_custom\";\n")
message("Building project first time")
try_compile(RESULT
@@ -70,11 +72,11 @@ execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
string(REGEX REPLACE "[\r\n]" " " out "${out}")
message("Run result: ${runResult} Output: \"${out}\"")
-if("${out}" STREQUAL "zot ")
+if("${out}" STREQUAL "[zot] [zot_custom] ")
message("Worked!")
-else("${out}" STREQUAL "zot ")
+else("${out}" STREQUAL "[zot] [zot_custom] ")
message(SEND_ERROR "Project did not initially build properly: ${out}")
-endif("${out}" STREQUAL "zot ")
+endif("${out}" STREQUAL "[zot] [zot_custom] ")
message("Waiting 3 seconds...")
# any additional argument will cause ${bar} to wait forever
@@ -85,6 +87,8 @@ write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
"const char* foo() { return \"foo changed\";}" )
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in
"static const char* zot = \"zot changed\";\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_custom.hxx.in
+ "static const char* zot_custom = \"zot_custom changed\";\n")
message("Building project second time")
try_compile(RESULT
@@ -137,8 +141,8 @@ execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
string(REGEX REPLACE "[\r\n]" " " out "${out}")
message("Run result: ${runResult} Output: \"${out}\"")
-if("${out}" STREQUAL "zot changed ")
+if("${out}" STREQUAL "[zot changed] [zot_custom changed] ")
message("Worked!")
-else("${out}" STREQUAL "zot changed ")
+else("${out}" STREQUAL "[zot changed] [zot_custom changed] ")
message(SEND_ERROR "Project did not rebuild properly!")
-endif("${out}" STREQUAL "zot changed ")
+endif("${out}" STREQUAL "[zot changed] [zot_custom changed] ")