diff options
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r-- | Modules/ExternalProject.cmake | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 9306ce6..9a6cbd6 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -525,9 +525,9 @@ External Project Definition option without the ``CMAKE_GENERATOR`` option. ``CMAKE_ARGS <arg>...`` - The specified arguments are passed to the ``cmake`` command line. They - can be any argument the ``cmake`` command understands, not just cache - values defined by ``-D...`` arguments (see also + The specified arguments are passed to the :program:`cmake` command line. + They can be any argument the :program:`cmake` command understands, not just + cache values defined by ``-D...`` arguments (see also :manual:`CMake Options <cmake(1)>`). .. versionadded:: 3.3 @@ -611,9 +611,9 @@ External Project Definition supported). If this option is not given, the default build command will be chosen to integrate with the main build in the most appropriate way (e.g. using recursive ``make`` for Makefile generators or - ``cmake --build`` if the project uses a CMake build). This option can be - specified with an empty string as the command to make the build step do - nothing. + :option:`cmake --build` if the project uses a CMake build). This option + can be specified with an empty string as the command to make the build + step do nothing. ``BUILD_IN_SOURCE <bool>`` When this option is enabled, the build will be done directly within the @@ -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 @@ -2073,13 +2090,7 @@ function(_ep_get_configuration_subdir_genex suffix_var) set(suffix "") get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - if(CMAKE_GENERATOR STREQUAL "Xcode") - # The Xcode generator does not support per-config sources, - # so use the underlying build system's placeholder instead. - set(suffix "/${CMAKE_CFG_INTDIR}") - else() - set(suffix "/$<CONFIG>") - endif() + set(suffix "/$<CONFIG>") endif() set(${suffix_var} "${suffix}" PARENT_SCOPE) endfunction() @@ -3641,7 +3652,7 @@ function(_ep_extract_configure_command var name) ) endif() - list(APPEND cmd "<SOURCE_DIR><SOURCE_SUBDIR>") + list(APPEND cmd -S "<SOURCE_DIR><SOURCE_SUBDIR>" -B "<BINARY_DIR>") endif() set("${var}" "${cmd}" PARENT_SCOPE) @@ -3845,6 +3856,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}]==]") @@ -3853,6 +3869,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} @@ -4080,6 +4097,7 @@ function(ExternalProject_Add name) # Install step options # INSTALL_COMMAND + INSTALL_BYPRODUCTS # # Test step options # |