mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-28 01:51:02 -06:00
Add an `INSTALL_JOB_SERVER_AWARE` option to `ExternalProject_Add`.
When using an explicit `INSTALL_COMMAND`, the generated commands
won't use `$(MAKE)` thus failing to connect to the outer make's
job server. Add an option enable explicit job server integration.
This is the install step's equivalent to the build step's
`BUILD_JOB_SERVER_AWARE` option added by commit bc43398e72
(ExternalProject: Enable Make Job Server with Explicit Build Command,
2023-08-09, v3.28.0-rc1~217^2). It is useful when the external
project's installation is driven by its build system. Note that with
Makefile generators, our default install command does use `$(MAKE)` to
connect to the outer make's job server.
Issue: #26398
19 lines
495 B
CMake
19 lines
495 B
CMake
include(ExternalProject)
|
|
ExternalProject_Add(Foo
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Foo
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR>
|
|
BUILD_JOB_SERVER_AWARE 1
|
|
INSTALL_COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR>
|
|
INSTALL_JOB_SERVER_AWARE 1
|
|
)
|
|
|
|
# Add a second step to test JOB_SERVER_AWARE
|
|
ExternalProject_Add_Step(Foo
|
|
second_step
|
|
COMMAND ${CMAKE_COMMAND} -E true
|
|
DEPENDEES build
|
|
ALWAYS 1
|
|
JOB_SERVER_AWARE 1
|
|
)
|