diff options
author | Harry Mallon <hjmallon@gmail.com> | 2022-09-08 12:30:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-12 13:53:22 (GMT) |
commit | 66b5d51f3812ecb04d1cc1901016236249e70b49 (patch) | |
tree | 1e174e1a84f2d1fccaba09cb6ed01d396677f0b5 | |
parent | 83686df1d63e7d2c922de19489ea2bab42e98a4a (diff) | |
download | CMake-66b5d51f3812ecb04d1cc1901016236249e70b49.zip CMake-66b5d51f3812ecb04d1cc1901016236249e70b49.tar.gz CMake-66b5d51f3812ecb04d1cc1901016236249e70b49.tar.bz2 |
ExternalProject: Install CMake projects using 'cmake --install'
In some cases, `cmake --install .` implements additional semantics over
just `cmake --build . --target install`. For example, using the Xcode
"new build system" with `IOS_INSTALL_COMBINED` requires special support
from `cmake --install` beyond building the `install` target.
Fixes: #23946
-rw-r--r-- | Modules/ExternalProject.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 9306ce6..22a25bd 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1840,7 +1840,11 @@ function(_ep_get_build_command else() set(cmd "${CMAKE_COMMAND}") endif() - set(args --build ".") + if(step STREQUAL "INSTALL") + set(args --install ".") + else() + set(args --build ".") + endif() get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) if (CMAKE_CFG_INTDIR AND @@ -1862,9 +1866,6 @@ 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}") |