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

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Jun 25 09:51:39 EDT 2007


Update of /cvsroot/CMake/CMake/Tests/Properties
In directory public:/mounts/ram/cvs-serv19620/Tests/Properties

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: some property cleanup and added GetProperty


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Properties/CMakeLists.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CMakeLists.txt	31 May 2007 14:29:13 -0000	1.1
+++ CMakeLists.txt	25 Jun 2007 13:51:37 -0000	1.2
@@ -20,8 +20,34 @@
 
 include_directories("${Properties_SOURCE_DIR}" "${Properties_BINARY_DIR}")
 
-if (RESULT1 AND RESULT2 AND RESULT3)
+
+# test generic property interfaces
+define_property(GLOBALTEST GLOBAL "A test property" 
+  "A long description of this test property" 0)
+set_properties(GLOBAL PROPERTIES GLOBALTEST 1)
+set_properties(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+  PROPERTIES DIRECTORYTEST 1)
+set_properties(SOURCE_FILE SubDir/properties3.cxx PROPERTIES SOURCETEST 1)
+get_property(GLOBALRESULT GLOBAL GLOBALTEST)
+get_property(DIRECTORYRESULT DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 
+  DIRECTORYTEST)
+get_property(SOURCE_FILERESULT SOURCE_FILE SubDir/properties3.cxx SOURCETEST)
+
+if (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
+    DIRECTORYRESULT AND SOURCE_FILERESULT)
   add_executable (Properties SubDir/properties3.cxx)
-else (RESULT1 AND RESULT2 AND RESULT3)
-  message("Error: test results are TEST1=${TEST1} TEST2=${TEST2} TEST3=${TEST3}")
-endif (RESULT1 AND RESULT2 AND RESULT3)
+else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
+    DIRECTORYRESULT AND SOURCE_FILERESULT)
+  message("Error: test results are RESULT1=${RESULT1} RESULT2=${RESULT2} "
+    "RESULT3=${RESULT3} GLOBALRESULT=${GLOBALRESULT} "
+    "DIRECTORYRESULT=${DIRECTORYRESULT} "
+    "SOURCE_FILERESULT=${SOURCE_FILERESULT}")
+endif (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
+  DIRECTORYRESULT AND SOURCE_FILERESULT)
+
+# test the target property
+set_properties(TARGET Properties PROPERTIES TARGETTEST 1)
+get_property(TARGETRESULT TARGET Properties TARGETTEST)
+if (NOT TARGETRESULT)
+    message("Error: target result is TARGETRESULT=${TARGETRESULT}")
+endif (NOT TARGETRESULT)



More information about the Cmake-commits mailing list