summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-14 16:58:32 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-14 16:58:32 (GMT)
commit5b02a4a864d2e68c683be6275709ce3e38d51fee (patch)
tree70b57c336d56db5afe08acfb7ab0ed4aa84c5b1b /Modules
parent8375bb4768f29f595c66140b77dd6b01713afb79 (diff)
downloadCMake-5b02a4a864d2e68c683be6275709ce3e38d51fee.zip
CMake-5b02a4a864d2e68c683be6275709ce3e38d51fee.tar.gz
CMake-5b02a4a864d2e68c683be6275709ce3e38d51fee.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CTestTargets.cmake55
1 files changed, 29 insertions, 26 deletions
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index bb4cdee..dc8b876 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -35,32 +35,35 @@ IF(CMAKE_CONFIGURATION_TYPES)
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)