diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-02-13 18:21:12 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-02-13 18:21:12 -0800 |
commit | ef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (patch) | |
tree | 6501b44707b5c6a88fa5f817adee1a3ffcb0012d /Modules/CTestTargets.cmake | |
parent | 035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (diff) | |
download | cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.gz cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.bz2 cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.zip |
Imported Upstream version 2.8.10.2upstream/2.8.10.2
Diffstat (limited to 'Modules/CTestTargets.cmake')
-rw-r--r-- | Modules/CTestTargets.cmake | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index bc4d9646a..fd4bd8024 100644 --- a/Modules/CTestTargets.cmake +++ b/Modules/CTestTargets.cmake @@ -12,29 +12,29 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -IF(NOT RUN_FROM_CTEST_OR_DART) - MESSAGE(FATAL_ERROR "Do not incldue CTestTargets.cmake directly") -ENDIF(NOT RUN_FROM_CTEST_OR_DART) +if(NOT RUN_FROM_CTEST_OR_DART) + message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly") +endif() # make directories in the binary tree -FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary) -GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH) -SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH}) -FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH}) -MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND) +file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary) +get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH) +set(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH}) +find_program(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH}) +mark_as_advanced(CMAKE_CTEST_COMMAND) # Use CTest # configure files -IF(CTEST_NEW_FORMAT) - CONFIGURE_FILE( +if(CTEST_NEW_FORMAT) + configure_file( ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${PROJECT_BINARY_DIR}/CTestConfiguration.ini ) -ELSE(CTEST_NEW_FORMAT) - CONFIGURE_FILE( +else() + configure_file( ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${PROJECT_BINARY_DIR}/DartConfiguration.tcl ) -ENDIF(CTEST_NEW_FORMAT) +endif() # # Section 3: @@ -43,53 +43,53 @@ ENDIF(CTEST_NEW_FORMAT) # These should NOT need to be modified from project to project. # -SET(__conf_types "") -IF(CMAKE_CONFIGURATION_TYPES) +set(__conf_types "") +if(CMAKE_CONFIGURATION_TYPES) # We need to pass the configuration type on the test command line. - SET(__conf_types -C "${CMAKE_CFG_INTDIR}") -ENDIF(CMAKE_CONFIGURATION_TYPES) + set(__conf_types -C "${CMAKE_CFG_INTDIR}") +endif() # Add convenience targets. Do this at most once in case of nested # projects. -DEFINE_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED +define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED BRIEF_DOCS "Internal property used by CTestTargets module." FULL_DOCS "Set by the CTestTargets module to track addition of testing targets." ) -GET_PROPERTY(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED) -IF(NOT _CTEST_TARGETS_ADDED) - SET_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) +get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED) +if(NOT _CTEST_TARGETS_ADDED) + set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) # For all generators add basic testing targets. - FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck) - ADD_CUSTOM_TARGET(${mode} + foreach(mode Experimental Nightly Continuous NightlyMemoryCheck) + add_custom_target(${mode} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode} ) - SET_PROPERTY(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") - SET_PROPERTY(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets") - ENDFOREACH(mode) + set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") + set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets") + endforeach() # For Makefile generators add more granular targets. - IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") + if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") # Make targets for Experimental builds - FOREACH(mode Nightly Experimental Continuous) - FOREACH(testtype + foreach(mode Nightly Experimental Continuous) + foreach(testtype Start Update Configure Build Test Coverage MemCheck Submit # missing purify ) - ADD_CUSTOM_TARGET(${mode}${testtype} + add_custom_target(${mode}${testtype} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype} ) - SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "") - SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") - ENDFOREACH(testtype) - ENDFOREACH(mode) - ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") + set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "") + set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") + endforeach() + endforeach() + endif() # If requested, add an alias that is the equivalent of the built-in "test" # or "RUN_TESTS" target: - IF(CTEST_TEST_TARGET_ALIAS) - ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS} + if(CTEST_TEST_TARGET_ALIAS) + add_custom_target(${CTEST_TEST_TARGET_ALIAS} ${CMAKE_CTEST_COMMAND} ${__conf_types} ) - ENDIF() -ENDIF(NOT _CTEST_TARGETS_ADDED) + endif() +endif() |