[cmake-commits] hoffman committed CMakeLists.txt 1.1 1.2

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 10 10:05:54 EDT 2007


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

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: add test for build depends


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BuildDepends/CMakeLists.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CMakeLists.txt	9 May 2007 19:10:12 -0000	1.1
+++ CMakeLists.txt	10 May 2007 14:05:52 -0000	1.2
@@ -13,19 +13,24 @@
   ${BuildDepends_SOURCE_DIR}/Project
   testRebuild
   OUTPUT_VARIABLE OUTPUT)
-
-set(bar ${BuildDepends_BINARY_DIR}/Project/bar.exe)
-if(EXISTS ${BuildDepends_BINARY_DIR}/Project/Debug/bar.exe )
-  set(bar ${BuildDepends_BINARY_DIR}/Project/Debug/bar.exe)
-endif(EXISTS ${BuildDepends_BINARY_DIR}/Project/Debug/bar.exe )
-  
-execute_process(COMMAND ${bar} OUTPUT_VARIABLE out)
+set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX})
+message("${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+if(EXISTS 
+    "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
+  message("found debug")
+  set(bar 
+    "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+endif(EXISTS 
+  "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+message("running ${bar}  ")
+execute_process(COMMAND ${bar} OUTPUT_VARIABLE out TIMEOUT 3)
+string(REGEX REPLACE "[\r\n]" " " out "${out}")
 message("${out}")
-if("${out}" STREQUAL "foo")
+if("${out}" STREQUAL "foo ")
   message("Worked!")
-else("${out}" STREQUAL "foo")
-  message(SEND_ERROR "Program did not rebuild with changed file")
-endif("${out}" STREQUAL "foo")
+else("${out}" STREQUAL "foo ")
+  message(SEND_ERROR "Program did not rebuild with changed file: ${out}")
+endif("${out}" STREQUAL "foo ")
 
 write_file(${BuildDepends_BINARY_DIR}/Project/foo.c 
   "const char* foo() { return \"foo changed\";}" )
@@ -35,11 +40,18 @@
   testRebuild
   OUTPUT_VARIABLE OUTPUT)
 
-execute_process(COMMAND ${bar} OUTPUT_VARIABLE out)
+if(EXISTS 
+    "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
+  message("found debug")
+endif(EXISTS 
+  "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+
+execute_process(COMMAND ${bar} OUTPUT_VARIABLE out TIMEOUT 3)
+string(REGEX REPLACE "[\r\n]" " " out "${out}")
 message("${out}")
 
-if("${out}" STREQUAL "foo changed")
+if("${out}" STREQUAL "foo changed ")
   message("Worked!")
-else("${out}" STREQUAL "foo changed")
+else("${out}" STREQUAL "foo changed ")
   message(SEND_ERROR "Program did not rebuild with changed file")
-endif("${out}" STREQUAL "foo changed")
+endif("${out}" STREQUAL "foo changed ")



More information about the Cmake-commits mailing list