diff --git a/Help/manual/cmake-instrumentation.7.rst b/Help/manual/cmake-instrumentation.7.rst index 7b2d1e6535..bb31858ac1 100644 --- a/Help/manual/cmake-instrumentation.7.rst +++ b/Help/manual/cmake-instrumentation.7.rst @@ -270,7 +270,7 @@ and contain the following data: ``target`` The CMake target associated with the command. Only included when ``role`` is - one of ``compile``, ``link``, ``custom``. + ``compile`` or ``link``. ``targetType`` The :prop_tgt:`TYPE` of the target. Only included when ``role`` is diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 2f25de7453..200bd7d2c4 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -268,7 +268,9 @@ int cmCTestLaunch::Run() { auto instrumentation = cmInstrumentation(this->Reporter.OptionBuildDir); std::map options; - options["target"] = this->Reporter.OptionTargetName; + if (this->Reporter.OptionTargetName != "TARGET_NAME") { + options["target"] = this->Reporter.OptionTargetName; + } options["source"] = this->Reporter.OptionSource; options["language"] = this->Reporter.OptionLanguage; options["targetType"] = this->Reporter.OptionTargetType; diff --git a/Tests/RunCMake/Instrumentation/verify-snippet.cmake b/Tests/RunCMake/Instrumentation/verify-snippet.cmake index ec997e37eb..33f9414dee 100644 --- a/Tests/RunCMake/Instrumentation/verify-snippet.cmake +++ b/Tests/RunCMake/Instrumentation/verify-snippet.cmake @@ -49,7 +49,6 @@ function(snippet_has_fields snippet contents) has_key("${snippet}" "${contents}" language) has_key("${snippet}" "${contents}" config) elseif (filename MATCHES "^custom-*") - has_key("${snippet}" "${contents}" target) has_key("${snippet}" "${contents}" outputs) has_key("${snippet}" "${contents}" outputSizes) elseif (filename MATCHES "^test-*")