[cmake-commits] king committed CMakeLists.txt 1.7 1.8

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Sep 17 10:51:07 EDT 2007


Update of /cvsroot/CMake/CMake/Tests/BuildDepends
In directory public:/mounts/ram/cvs-serv4088/Tests/BuildDepends

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: Adding test for ADD_CUSTOM_COMMAND's new IMPLICIT_DEPENDS feature.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BuildDepends/CMakeLists.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CMakeLists.txt	14 Jun 2007 12:33:21 -0000	1.7
+++ CMakeLists.txt	17 Sep 2007 14:51:05 -0000	1.8
@@ -11,6 +11,9 @@
 write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx 
   "const char* foo() { return \"foo\";}" )
 
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in
+  "static const char* zot = \"zot\";\n")
+
 message("Building project first time")
 try_compile(RESULT 
   ${BuildDepends_BINARY_DIR}/Project
@@ -42,6 +45,14 @@
     "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
 endif(EXISTS 
   "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+set(zot ${BuildDepends_BINARY_DIR}/Project/zot${CMAKE_EXECUTABLE_SUFFIX})
+if(EXISTS 
+    "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" )
+  message("found debug")
+  set(zot 
+    "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
+endif(EXISTS 
+  "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
 
 message("Running ${bar}  ")
 execute_process(COMMAND ${bar} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
@@ -54,6 +65,17 @@
   message(SEND_ERROR "Project did not initially build properly: ${out}")
 endif("${out}" STREQUAL "foo ")
 
+message("Running ${zot}  ")
+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 ")
+  message("Worked!")
+else("${out}" STREQUAL "zot ")
+  message(SEND_ERROR "Project did not initially build properly: ${out}")
+endif("${out}" STREQUAL "zot ")
+
 message("Waiting 3 seconds...")
 # any additional argument will cause ${bar} to wait forever
 execute_process(COMMAND ${bar} -infinite TIMEOUT 3 OUTPUT_VARIABLE out)
@@ -61,6 +83,8 @@
 message("Modifying Project/foo.cxx")
 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")
 
 message("Building project second time")
 try_compile(RESULT 
@@ -91,6 +115,11 @@
   message("found debug")
 endif(EXISTS 
   "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+if(EXISTS 
+    "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" )
+  message("found debug")
+endif(EXISTS 
+  "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
 
 message("Running ${bar}  ")
 execute_process(COMMAND ${bar} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
@@ -102,3 +131,14 @@
 else("${out}" STREQUAL "foo changed ")
   message(SEND_ERROR "Project did not rebuild properly!")
 endif("${out}" STREQUAL "foo changed ")
+
+message("Running ${zot}  ")
+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 ")
+  message("Worked!")
+else("${out}" STREQUAL "zot changed ")
+  message(SEND_ERROR "Project did not rebuild properly!")
+endif("${out}" STREQUAL "zot changed ")



More information about the Cmake-commits mailing list