summaryrefslogtreecommitdiff
path: root/Modules/CTestUseLaunchers.cmake
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2017-10-11 15:16:57 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-10-11 15:16:57 +0900
commit915c76ded744c0f5f151402b9fa69f3fd8452573 (patch)
treeca6a387466543248890f346847acaa8343989b22 /Modules/CTestUseLaunchers.cmake
parent317dbdb79761ef65e45c7358cfc7571c6afa54ad (diff)
downloadcmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.gz
cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.bz2
cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.zip
Imported Upstream version 3.9.4upstream/3.9.4
Diffstat (limited to 'Modules/CTestUseLaunchers.cmake')
-rw-r--r--Modules/CTestUseLaunchers.cmake78
1 files changed, 49 insertions, 29 deletions
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
index 24f5f2e16..dc90513a9 100644
--- a/Modules/CTestUseLaunchers.cmake
+++ b/Modules/CTestUseLaunchers.cmake
@@ -1,34 +1,32 @@
-# - Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#.rst:
+# CTestUseLaunchers
+# -----------------
+#
+# Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+#
# CTestUseLaunchers is automatically included when you include(CTest).
-# However, it is split out into its own module file so projects
-# can use the CTEST_USE_LAUNCHERS functionality independently.
+# However, it is split out into its own module file so projects can use
+# the CTEST_USE_LAUNCHERS functionality independently.
#
# 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
-# 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.
-#
-# 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.
-
-#=============================================================================
-# Copyright 2008-2012 Kitware, Inc.
+# 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.
#
-# 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.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
+# 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. If CTEST_USE_LAUNCHERS is on in a ctest -S script
+# the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
+# to the cmake command used to configure the project.
if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
set(CTEST_USE_LAUNCHERS "$ENV{CTEST_USE_LAUNCHERS_DEFAULT}"
@@ -40,9 +38,31 @@ if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
endif()
if(CTEST_USE_LAUNCHERS)
- set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
- set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
- set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
+ 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")
+ string(APPEND __launch_compile_options " --filter-prefix <CMAKE_CL_SHOWINCLUDES_PREFIX>")
+ 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} --")
+
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}")