[cmake-commits] andy committed CMakeLists.txt 1.2 1.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed May 16 07:55:01 EDT 2007


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

Modified Files:
	CMakeLists.txt 
Log Message:
BUG: fix test for hp move to c++ to avoid ansi issues and produce a message if the compile fails, (really checked in by Bill H.)


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BuildDepends/CMakeLists.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CMakeLists.txt	10 May 2007 14:05:52 -0000	1.2
+++ CMakeLists.txt	16 May 2007 11:54:59 -0000	1.3
@@ -6,13 +6,17 @@
 # and source files for the test project. 
 project(BuildDepends)
 make_directory(${BuildDepends_BINARY_DIR}/Project)
-write_file(${BuildDepends_BINARY_DIR}/Project/foo.c 
+write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx 
   "const char* foo() { return \"foo\";}" )
 try_compile(RESULT 
   ${BuildDepends_BINARY_DIR}/Project
   ${BuildDepends_SOURCE_DIR}/Project
   testRebuild
   OUTPUT_VARIABLE OUTPUT)
+if(NOT RESULT)
+  message(SEND_ERROR "Could not build test project: ${OUTPUT}")
+endif(NOT RESULT)
+
 set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX})
 message("${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
 if(EXISTS 
@@ -32,7 +36,7 @@
   message(SEND_ERROR "Program did not rebuild with changed file: ${out}")
 endif("${out}" STREQUAL "foo ")
 
-write_file(${BuildDepends_BINARY_DIR}/Project/foo.c 
+write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
   "const char* foo() { return \"foo changed\";}" )
 try_compile(RESULT 
   ${BuildDepends_BINARY_DIR}/Project
@@ -40,6 +44,9 @@
   testRebuild
   OUTPUT_VARIABLE OUTPUT)
 
+if(NOT RESULT)
+  message(SEND_ERROR "Could not build test project: ${OUTPUT}")
+endif(NOT RESULT)
 if(EXISTS 
     "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
   message("found debug")



More information about the Cmake-commits mailing list