[cmake-commits] martink committed CMakeLists.txt 1.61 1.62 cmTestConfigure.h.in 1.22 1.23

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 22 11:49:58 EDT 2006


Update of /cvsroot/CMake/CMake/Tests/Complex
In directory public:/mounts/ram/cvs-serv3773

Modified Files:
	CMakeLists.txt cmTestConfigure.h.in 
Log Message:
ENH: added test for elseif


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/CMakeLists.txt,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- CMakeLists.txt	12 May 2006 14:54:09 -0000	1.61
+++ CMakeLists.txt	22 Sep 2006 15:49:56 -0000	1.62
@@ -271,6 +271,44 @@
 
 SET(SHOULD_BE_ZERO )
 SET(SHOULD_BE_ONE 1)
+
+# test elseif functionality, the mess below tries to catch problem 
+# of clauses being executed early or late etc
+set (RESULT 3)
+if (RESULT EQUAL 1)
+  if (RESULT EQUAL 2)
+    set (ELSEIF_RESULT 1)
+  elseif (RESULT EQUAL 3)
+    set (ELSEIF_RESULT 1)
+  endif (RESULT EQUAL 2)  
+elseif (RESULT EQUAL 2)
+  set (ELSEIF_RESULT 1)
+elseif (RESULT EQUAL 3)
+  if (RESULT EQUAL 2)
+    set (ELSEIF_RESULT 1)
+  elseif (RESULT EQUAL 3)
+    if (NOT ELSEIF_RESULT EQUAL 1)
+      set (ELSEIF_RESULT 2)
+    endif (NOT ELSEIF_RESULT EQUAL 1)      
+  endif (RESULT EQUAL 2)  
+elseif (RESULT EQUAL 4)
+  if (RESULT EQUAL 2)
+    set (ELSEIF_RESULT 1)
+  elseif (RESULT EQUAL 3)
+    set (ELSEIF_RESULT 1)
+  endif (RESULT EQUAL 2)  
+else (RESULT  EQUAL 1)
+  if (RESULT EQUAL 2)
+    set (ELSEIF_RESULT 1)
+  elseif (RESULT EQUAL 3)
+    set (ELSEIF_RESULT 1)
+  endif (RESULT EQUAL 2)  
+endif (RESULT EQUAL 1)
+
+if (NOT ELSEIF_RESULT EQUAL 2)
+  set (ELSEIF_RESULT 0)
+endif (NOT ELSEIF_RESULT EQUAL 2)
+
 #
 # Configure file 
 # (plug vars to #define so that they can be tested)
@@ -303,6 +341,7 @@
     "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
 ENDIF(NOT STRING_REGEX_PASSED)
 
+
 #
 # Create the libs and the main exe
 #

Index: cmTestConfigure.h.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/cmTestConfigure.h.in,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmTestConfigure.h.in	16 Mar 2006 22:20:09 -0000	1.22
+++ cmTestConfigure.h.in	22 Sep 2006 15:49:56 -0000	1.23
@@ -77,3 +77,6 @@
 
 #define CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_MODULE_PREFIX}"
 #define CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_MODULE_SUFFIX}"
+
+// test elseif
+#cmakedefine ELSEIF_RESULT



More information about the Cmake-commits mailing list