Files
CMake/Tests/RunCMake/ExternalProject/GNUMakeJobServerAware.cmake
Ben Boeckel 050f891d81 Tests: choose an explicit FULL strategy in tests expecting it
Since it can be set in the environment when running the test suite,
guard tests which are sensitive to intermediate directory strategy
changes with explicit settings.
2025-07-29 08:06:30 -04:00

21 lines
560 B
CMake

set(CMAKE_INTERMEDIATE_DIR_STRATEGY FULL CACHE STRING "" FORCE)
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
)