Commit 54f15cbb authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'AddFileDependencies-deprecate'

9cddaad9 AddFileDependencies: Deprecate this unnecessary module
4841d38a MacroAddFileDependencies: Explicitly deprecate by documentation
777c14af

 MacroAddFileDependencies: Simplify implementation
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5788
parents f7dd651c 9cddaad9
Pipeline #213485 canceled with stages
in 43 seconds
......@@ -15,7 +15,6 @@ These modules are loaded using the :command:`include` command.
.. toctree::
:maxdepth: 1
/module/AddFileDependencies
/module/AndroidTestUtilities
/module/BundleUtilities
/module/CheckCCompilerFlag
......@@ -272,6 +271,7 @@ Deprecated Utility Modules
.. toctree::
:maxdepth: 1
/module/AddFileDependencies
/module/CMakeDetermineVSServicePack
/module/CMakeExpandImportedTargets
/module/CMakeForceCompiler
......
AddFileDependencies-deprecate
-----------------------------
* The :module:`AddFileDependencies` module is deprecated.
Port projects to use :command:`set_property` directly.
......@@ -5,13 +5,25 @@
AddFileDependencies
-------------------
.. deprecated:: 3.20
Add dependencies to a source file.
.. code-block:: cmake
add_file_dependencies(<source> <files>)
add_file_dependencies(<source> <files>...)
Adds the given ``<files>`` to the dependencies of file ``<source>``.
Do not use this command in new code. It is just a wrapper around:
.. code-block:: cmake
set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
Instead use the :command:`set_property` command to append to the
:prop_sf:`OBJECT_DEPENDS` source file property directly.
#]=======================================================================]
function(add_file_dependencies _file)
......
......@@ -5,26 +5,25 @@
MacroAddFileDependencies
------------------------
MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
.. deprecated:: 3.14
Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
are usually better ways to specify the correct dependencies.
::
MACRO_ADD_FILE_DEPENDENCIES(<source> <files>...)
Do not use this command in new code. It is just a wrapper around:
.. code-block:: cmake
set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
Instead use the :command:`set_property` command to append to the
:prop_sf:`OBJECT_DEPENDS` source file property directly.
MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
convenience wrapper around the OBJECT_DEPENDS source file property.
You can just use set_property(SOURCE <file> APPEND PROPERTY
OBJECT_DEPENDS depend_files) instead.
#]=======================================================================]
macro (MACRO_ADD_FILE_DEPENDENCIES _file)
get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
if (_deps)
set(_deps ${_deps} ${ARGN})
else ()
set(_deps ${ARGN})
endif ()
set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
endmacro ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment