[cmake-commits] king committed CTestTargets.cmake 1.2 1.3

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 14 11:58:34 EST 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv20130/Modules

Modified Files:
	CTestTargets.cmake 
Log Message:
ENH: Re-enable diagnosis of non-unique target names.

  - Re-enable enforcement in cmMakefile::EnforceUniqueName
  - Improve error message to help user resolve the problem
  - Fix Modules/CTestTargets.cmake to not duplicate testing targets
  - Move commands used by the changes to Modules/CTestTargets.cmake
    to build during bootstrap: DEFINE_PROPERTY, GET_PROPERTY


Index: CTestTargets.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CTestTargets.cmake,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CTestTargets.cmake	12 Oct 2006 17:15:03 -0000	1.2
+++ CTestTargets.cmake	14 Feb 2008 16:58:32 -0000	1.3
@@ -35,32 +35,35 @@
   SET(__conf_types -C "${CMAKE_CFG_INTDIR}")
 ENDIF(CMAKE_CONFIGURATION_TYPES)
 
-# add testing targets
-IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
-  FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
-    ADD_CUSTOM_TARGET(${mode} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode})
-  ENDFOREACH(mode)
-ELSE(${CMAKE_MAKE_PROGRAM} MATCHES make)
-  # for IDE only add them once for nested projects
-  IF (NOT DART_COMMON_TARGETS_ADDED)
-    FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
-      ADD_CUSTOM_TARGET(${mode} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode})
-    ENDFOREACH(mode)
-    SET (DART_COMMON_TARGETS_ADDED 1)
-  ENDIF (NOT DART_COMMON_TARGETS_ADDED)
-ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES make)
-
+# Add convenience targets.  Do this at most once in case of nested
+# projects.
+DEFINE_PROPERTY(CTEST_TARGETS_ADDED GLOBAL
+  "Internal property used by CTestTargets module."
+  "Set by the CTestTargets module to track addition of testing targets."
+  FALSE)
+GET_PROPERTY(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
+IF(NOT _CTEST_TARGETS_ADDED)
+  SET_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
 
-# for non IDE based builds nmake and make 
-# add all these extra targets 
-IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
-  # Make targets for Experimental builds
-  FOREACH(mode Nightly Experimental Continuous)
-    FOREACH(testtype Start Update Configure Build Test Coverage MemCheck Submit)
-      # missing purify
-      ADD_CUSTOM_TARGET(${mode}${testtype} 
-        ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype})
-    ENDFOREACH(testtype)
+  # For all generators add basic testing targets.
+  FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
+    ADD_CUSTOM_TARGET(${mode}
+      ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
+      )
   ENDFOREACH(mode)
-ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
 
+  # For Makefile generators add more granular targets.
+  IF("${CMAKE_GENERATOR}" MATCHES Make)
+    # Make targets for Experimental builds
+    FOREACH(mode Nightly Experimental Continuous)
+      FOREACH(testtype
+          Start Update Configure Build Test Coverage MemCheck Submit
+          # missing purify
+          )
+        ADD_CUSTOM_TARGET(${mode}${testtype}
+          ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
+          )
+      ENDFOREACH(testtype)
+    ENDFOREACH(mode)
+  ENDIF("${CMAKE_GENERATOR}" MATCHES Make)
+ENDIF(NOT _CTEST_TARGETS_ADDED)



More information about the Cmake-commits mailing list