2009-09-28 19:46:51 +04:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2005-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:46:51 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(NOT RUN_FROM_CTEST_OR_DART)
|
|
|
|
message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2005-08-03 21:19:36 +04:00
|
|
|
|
|
|
|
# make directories in the binary tree
|
2012-08-13 21:47:32 +04:00
|
|
|
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)
|
2005-08-03 21:19:36 +04:00
|
|
|
|
|
|
|
# Use CTest
|
|
|
|
# configure files
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(CTEST_NEW_FORMAT)
|
|
|
|
configure_file(
|
2005-08-03 21:19:36 +04:00
|
|
|
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
|
|
|
|
${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
configure_file(
|
2005-08-03 21:19:36 +04:00
|
|
|
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
|
|
|
|
${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2005-08-03 21:19:36 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Section 3:
|
|
|
|
#
|
|
|
|
# Custom targets to perform dashboard builds and submissions.
|
|
|
|
# These should NOT need to be modified from project to project.
|
|
|
|
#
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(__conf_types "")
|
|
|
|
if(CMAKE_CONFIGURATION_TYPES)
|
2006-10-12 21:15:03 +04:00
|
|
|
# We need to pass the configuration type on the test command line.
|
2012-08-13 21:47:32 +04:00
|
|
|
set(__conf_types -C "${CMAKE_CFG_INTDIR}")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2006-10-12 21:15:03 +04:00
|
|
|
|
2008-02-14 19:58:32 +03:00
|
|
|
# Add convenience targets. Do this at most once in case of nested
|
|
|
|
# projects.
|
2012-08-13 21:47:32 +04:00
|
|
|
define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED
|
2008-02-14 21:36:23 +03:00
|
|
|
BRIEF_DOCS "Internal property used by CTestTargets module."
|
|
|
|
FULL_DOCS "Set by the CTestTargets module to track addition of testing targets."
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
|
|
|
|
if(NOT _CTEST_TARGETS_ADDED)
|
|
|
|
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
|
2005-08-03 21:19:36 +04:00
|
|
|
|
2008-02-14 19:58:32 +03:00
|
|
|
# For all generators add basic testing targets.
|
2012-08-13 21:47:32 +04:00
|
|
|
foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
|
|
|
|
add_custom_target(${mode}
|
2008-02-14 19:58:32 +03:00
|
|
|
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
|
|
|
|
set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach()
|
2005-08-03 21:19:36 +04:00
|
|
|
|
2008-02-14 19:58:32 +03:00
|
|
|
# For Makefile generators add more granular targets.
|
2012-08-13 21:47:32 +04:00
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
|
2008-02-14 19:58:32 +03:00
|
|
|
# Make targets for Experimental builds
|
2012-08-13 21:47:32 +04:00
|
|
|
foreach(mode Nightly Experimental Continuous)
|
|
|
|
foreach(testtype
|
2008-02-14 19:58:32 +03:00
|
|
|
Start Update Configure Build Test Coverage MemCheck Submit
|
|
|
|
# missing purify
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
add_custom_target(${mode}${testtype}
|
2008-02-14 19:58:32 +03:00
|
|
|
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
|
|
|
|
set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2011-02-01 23:37:25 +03:00
|
|
|
|
|
|
|
# If requested, add an alias that is the equivalent of the built-in "test"
|
|
|
|
# or "RUN_TESTS" target:
|
2012-08-13 21:47:32 +04:00
|
|
|
if(CTEST_TEST_TARGET_ALIAS)
|
|
|
|
add_custom_target(${CTEST_TEST_TARGET_ALIAS}
|
2011-02-01 23:37:25 +03:00
|
|
|
${CMAKE_CTEST_COMMAND} ${__conf_types}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
endif()
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|