mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
Add `install_prep/<component>` convenience targets to the Ninja
generators to build dependencies of install components, and
`install_prep/all` to build the dependencies of all install components.
This is similar in flavor to commit ba6b6fbc24 (Ninja: Add Build
Dependencies for Tests, 2026-04-07), but here for the install command.
Co-authored-by: Tyler Yankee <tyler.yankee@kitware.com>
Issue: #27643
20 lines
691 B
CMake
20 lines
691 B
CMake
include(GeneratedCommon.cmake)
|
|
|
|
# install(FILES) and install(PROGRAMS) imply build dependencies only for files
|
|
# that the build generates. A file produced by a custom command attached to
|
|
# a single target is prepared by running only that command.
|
|
add_generated_file(generated_file generated.txt)
|
|
add_generated_file(generated_program generated.sh)
|
|
add_library(generated_files STATIC EXCLUDE_FROM_ALL
|
|
"${generated_target_source}" "${generated_file}" "${generated_program}")
|
|
install(FILES "${generated_file}" lib.c
|
|
DESTINATION share/install-prep
|
|
COMPONENT Files
|
|
)
|
|
install(PROGRAMS "${generated_program}"
|
|
DESTINATION bin
|
|
COMPONENT Files
|
|
)
|
|
|
|
add_library(unit_tests STATIC neverbuild.c)
|