summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake17
-rw-r--r--Modules/FetchContent.cmake3
-rw-r--r--Modules/FetchContent/CMakeLists.cmake.in1
-rw-r--r--Modules/GoogleTestAddTests.cmake9
4 files changed, 23 insertions, 7 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 05af822..14864d5 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -407,7 +407,7 @@ External Project Definition
``CVS_TAG <tag>``
Tag to checkout from the CVS repository.
- **Update/Patch Step Options:**
+ **Update Step Options:**
Whenever CMake is re-run, by default the external project's sources will be
updated if the download method supports updates (e.g. a git repository
would be checked if the ``GIT_TAG`` does not refer to a specific commit).
@@ -442,6 +442,7 @@ External Project Definition
This may cause a step target to be created automatically for the
``download`` step. See policy :policy:`CMP0114`.
+ **Patch Step Options:**
``PATCH_COMMAND <cmd>...``
Specifies a custom command to patch the sources after an update. By
default, no patch command is defined. Note that it can be quite difficult
@@ -750,6 +751,11 @@ External Project Definition
``USES_TERMINAL_UPDATE <bool>``
Give the update step access to the terminal.
+ ``USES_TERMINAL_PATCH <bool>``
+ .. versionadded:: 3.23
+
+ Give the patch step access to the terminal.
+
``USES_TERMINAL_CONFIGURE <bool>``
Give the configure step access to the terminal.
@@ -3024,6 +3030,13 @@ function(_ep_add_patch_command name)
set(log "")
endif()
+ get_property(uses_terminal TARGET ${name} PROPERTY _EP_USES_TERMINAL_PATCH)
+ if(uses_terminal)
+ set(uses_terminal USES_TERMINAL 1)
+ else()
+ set(uses_terminal "")
+ endif()
+
_ep_get_update_disconnected(update_disconnected ${name})
if(update_disconnected)
set(patch_dep download)
@@ -3042,6 +3055,7 @@ function(_ep_add_patch_command name)
WORKING_DIRECTORY \${work_dir}
DEPENDEES \${patch_dep}
${log}
+ ${uses_terminal}
)"
)
endfunction()
@@ -3557,6 +3571,7 @@ function(ExternalProject_Add name)
#
USES_TERMINAL_DOWNLOAD
USES_TERMINAL_UPDATE
+ USES_TERMINAL_PATCH
USES_TERMINAL_CONFIGURE
USES_TERMINAL_BUILD
USES_TERMINAL_INSTALL
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 691d4ac..7e14756 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -920,13 +920,14 @@ function(__FetchContent_directPopulate contentName)
BUILD_COMMAND
INSTALL_COMMAND
TEST_COMMAND
- # We force both of these to be ON since we are always executing serially
+ # We force these to be ON since we are always executing serially
# and we want all steps to have access to the terminal in case they
# need input from the command line (e.g. ask for a private key password)
# or they want to provide timely progress. We silently absorb and
# discard these if they are set by the caller.
USES_TERMINAL_DOWNLOAD
USES_TERMINAL_UPDATE
+ USES_TERMINAL_PATCH
)
set(multiValueArgs "")
diff --git a/Modules/FetchContent/CMakeLists.cmake.in b/Modules/FetchContent/CMakeLists.cmake.in
index 5ebb12f..d94b0f4 100644
--- a/Modules/FetchContent/CMakeLists.cmake.in
+++ b/Modules/FetchContent/CMakeLists.cmake.in
@@ -22,6 +22,7 @@ ExternalProject_Add(${contentName}-populate
TEST_COMMAND ""
USES_TERMINAL_DOWNLOAD YES
USES_TERMINAL_UPDATE YES
+ USES_TERMINAL_PATCH YES
)
@__FETCHCONTENT_COPY_FILE@
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 7043b2b..a10b5d0 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -142,15 +142,14 @@ function(gtest_discover_tests_impl)
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
else()
- # Test name; strip spaces and comments to get just the name...
- string(REGEX REPLACE " +" "" test "${line}")
+ string(STRIP "${line}" test)
if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
- string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
+ string(REGEX REPLACE "/[0-9]+[ #]+GetParam\\(\\) = " "/" pretty_test "${test}")
else()
- string(REGEX REPLACE "#.*" "" pretty_test "${test}")
+ string(REGEX REPLACE " +#.*" "" pretty_test "${test}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
- string(REGEX REPLACE "#.*" "" test "${test}")
+ string(REGEX REPLACE " +#.*" "" test "${test}")
if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
else()