diff options
author | Brad King <brad.king@kitware.com> | 2022-11-07 13:57:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-11-07 13:57:13 (GMT) |
commit | 4ac37b8a0e4477028871e17e4ec54fc3c79f6ee3 (patch) | |
tree | fb3b96f5a38505fc0247d34d152cb81fd93d884b /Modules | |
parent | e232e1bed3143c132f707bfe9efaa9c62cca2f04 (diff) | |
parent | 8c6b2928f4b71f87ba6ef6ccfaa7ba1c767f3097 (diff) | |
download | CMake-4ac37b8a0e4477028871e17e4ec54fc3c79f6ee3.zip CMake-4ac37b8a0e4477028871e17e4ec54fc3c79f6ee3.tar.gz CMake-4ac37b8a0e4477028871e17e4ec54fc3c79f6ee3.tar.bz2 |
Merge topic 'ExternalProject-INSTALL_BYPRODUCTS'
8c6b2928f4 ExternalProject: Add `INSTALL_BYPRODUCTS` option
6d6baffb85 Tests: Fix ExternalLibraryWithSubstitution test
4bcfff2df3 ExternalProject: Clarify `BYPRODUCTS` docs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7866
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 141b185..9fecd8f 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -637,8 +637,11 @@ External Project Definition Specifies files that will be generated by the build command but which might or might not have their modification time updated by subsequent - builds. These ultimately get passed through as ``BYPRODUCTS`` to the - build step's own underlying call to :command:`add_custom_command`. + builds. This may also be required to explicitly declare dependencies + when using the :generator:`Ninja` generator. + These ultimately get passed through as ``BYPRODUCTS`` to the + build step's own underlying call to :command:`add_custom_command`, which + has additional documentation. **Install Step Options:** If the configure step assumed the external project uses CMake as its build @@ -661,6 +664,17 @@ External Project Definition supported). Passing an empty string as the ``<cmd>`` makes the install step do nothing. + ``INSTALL_BYPRODUCTS <file>...`` + .. versionadded:: 3.26 + + Specifies files that will be generated by the install command but which + might or might not have their modification time updated by subsequent + installs. This may also be required to explicitly declare dependencies + when using the :generator:`Ninja` generator. + These ultimately get passed through as ``BYPRODUCTS`` to the + install step's own underlying call to :command:`add_custom_command`, which + has additional documentation. + .. note:: If the :envvar:`CMAKE_INSTALL_MODE` environment variable is set when the main project is built, it will only have an effect if the following @@ -943,9 +957,12 @@ control needed to implement such step-level capabilities. .. versionadded:: 3.2 Files that will be generated by this custom step but which might or might - not have their modification time updated by subsequent builds. This list of + not have their modification time updated by subsequent builds. + This may also be required to explicitly declare dependencies + when using the :generator:`Ninja` generator. This list of files will ultimately be passed through as the ``BYPRODUCTS`` option to the - :command:`add_custom_command` used to implement the custom step internally. + :command:`add_custom_command` used to implement the custom step internally, + which has additional documentation. ``ALWAYS <bool>`` When enabled, this option specifies that the custom step should always be @@ -3846,6 +3863,11 @@ function(_ep_add_install_command name) set(always 0) endif() + get_property(install_byproducts + TARGET ${name} + PROPERTY _EP_INSTALL_BYPRODUCTS + ) + set(__cmdQuoted) foreach(__item IN LISTS cmd) string(APPEND __cmdQuoted " [==[${__item}]==]") @@ -3854,6 +3876,7 @@ function(_ep_add_install_command name) ExternalProject_Add_Step(${name} install INDEPENDENT FALSE COMMAND ${__cmdQuoted} + BYPRODUCTS \${install_byproducts} WORKING_DIRECTORY \${binary_dir} DEPENDEES build ALWAYS \${always} @@ -4081,6 +4104,7 @@ function(ExternalProject_Add name) # Install step options # INSTALL_COMMAND + INSTALL_BYPRODUCTS # # Test step options # |