2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# CTestUseLaunchers
|
|
|
|
# -----------------
|
|
|
|
#
|
|
|
|
# Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
|
|
|
|
#
|
2012-10-15 22:34:01 +04:00
|
|
|
# CTestUseLaunchers is automatically included when you include(CTest).
|
2013-10-15 19:17:36 +04:00
|
|
|
# However, it is split out into its own module file so projects can use
|
|
|
|
# the CTEST_USE_LAUNCHERS functionality independently.
|
2012-10-15 22:34:01 +04:00
|
|
|
#
|
|
|
|
# To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
|
|
|
|
# dashboard script, and then also set it in the cache of the configured
|
2013-10-15 19:17:36 +04:00
|
|
|
# project. Both cmake and ctest need to know the value of it for the
|
|
|
|
# launchers to work properly. CMake needs to know in order to generate
|
|
|
|
# proper build rules, and ctest, in order to produce the proper error
|
|
|
|
# and warning analysis.
|
2012-10-15 22:34:01 +04:00
|
|
|
#
|
2013-10-15 19:17:36 +04:00
|
|
|
# For convenience, you may set the ENV variable
|
|
|
|
# CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too. Then, as
|
|
|
|
# long as your CMakeLists uses include(CTest) or
|
|
|
|
# include(CTestUseLaunchers), it will use the value of the ENV variable
|
|
|
|
# to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
|
|
|
|
# variable initialization only occurs if CTEST_USE_LAUNCHERS is not
|
|
|
|
# already defined.
|
2012-10-15 22:34:01 +04:00
|
|
|
|
|
|
|
if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
|
|
|
|
set(CTEST_USE_LAUNCHERS "$ENV{CTEST_USE_LAUNCHERS_DEFAULT}"
|
|
|
|
CACHE INTERNAL "CTEST_USE_LAUNCHERS initial value from ENV")
|
|
|
|
endif()
|
|
|
|
|
2012-11-30 05:21:35 +04:00
|
|
|
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
|
2012-10-15 22:34:01 +04:00
|
|
|
set(CTEST_USE_LAUNCHERS 0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CTEST_USE_LAUNCHERS)
|
2013-12-02 02:16:06 +04:00
|
|
|
set(__launch_common_options
|
|
|
|
"--target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR>")
|
|
|
|
|
|
|
|
set(__launch_compile_options
|
|
|
|
"${__launch_common_options} --output <OBJECT> --source <SOURCE> --language <LANGUAGE>")
|
|
|
|
|
|
|
|
set(__launch_link_options
|
|
|
|
"${__launch_common_options} --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE>")
|
|
|
|
|
|
|
|
set(__launch_custom_options
|
|
|
|
"${__launch_common_options} --output <OUTPUT>")
|
|
|
|
|
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
|
2016-07-28 01:41:13 +03:00
|
|
|
string(APPEND __launch_compile_options " --filter-prefix <CMAKE_CL_SHOWINCLUDES_PREFIX>")
|
2013-12-02 02:16:06 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CTEST_LAUNCH_COMPILE
|
|
|
|
"\"${CMAKE_CTEST_COMMAND}\" --launch ${__launch_compile_options} --")
|
|
|
|
|
|
|
|
set(CTEST_LAUNCH_LINK
|
|
|
|
"\"${CMAKE_CTEST_COMMAND}\" --launch ${__launch_link_options} --")
|
|
|
|
|
|
|
|
set(CTEST_LAUNCH_CUSTOM
|
|
|
|
"\"${CMAKE_CTEST_COMMAND}\" --launch ${__launch_custom_options} --")
|
|
|
|
|
2012-10-15 22:34:01 +04:00
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
|
|
|
|
endif()
|