summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-02 18:46:44 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-02 19:28:26 (GMT)
commit771387523a02e0c1ef5f68d20e9efc210b19c868 (patch)
treef6fe6fe687a42bd20bede30358d0cfeeca818375 /Modules
parente2f1d6e7bdc398530fdd61b996ba1a87ecc54044 (diff)
downloadCMake-771387523a02e0c1ef5f68d20e9efc210b19c868.zip
CMake-771387523a02e0c1ef5f68d20e9efc210b19c868.tar.gz
CMake-771387523a02e0c1ef5f68d20e9efc210b19c868.tar.bz2
ExternalProject: Restore driving install through build system
Revert commit 66b5d51f38 (ExternalProject: Install CMake projects using 'cmake --install', 2022-09-08, v3.25.0-rc1~150^2). It changed the ExternalProject install step command from: cmake --build <dir> --target install --config <cfg> to: cmake --install <dir> --config <cfg> The latter command no longer runs the external project build system during the install step. We could consider using the commands: cmake --build <dir> --target all --config <cfg> cmake --install <dir> --config <cfg> as the install step, but if `CMAKE_SKIP_INSTALL_ALL_DEPENDENCY` is used in the external project, that can change semantics too. Revert the original change pending further investigation on other ways to support its motivating use case. Add a test covering the previously-regressed use case. Fixes: #24567 Issue: #23946
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake9
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 22a25bd..9306ce6 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1840,11 +1840,7 @@ function(_ep_get_build_command
else()
set(cmd "${CMAKE_COMMAND}")
endif()
- if(step STREQUAL "INSTALL")
- set(args --install ".")
- else()
- set(args --build ".")
- endif()
+ set(args --build ".")
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
if (CMAKE_CFG_INTDIR AND
@@ -1866,6 +1862,9 @@ function(_ep_get_build_command
endif()
list(APPEND args --config ${config})
endif()
+ if(step STREQUAL "INSTALL")
+ list(APPEND args --target install)
+ endif()
# But for "TEST" drive the project with corresponding "ctest".
if("x${step}x" STREQUAL "xTESTx")
string(REGEX REPLACE "^(.*/)cmake([^/]*)$" "\\1ctest\\2" cmd "${cmd}")