AddFileDependencies, MacroAddFileDependencies: Update documentation

- Extended the deprecation notice.
- Synced modules descriptions with other similar modules.
- Added info about the MacroAddFileDependencies deprecation in the
  3.14 release notes.
This commit is contained in:
Peter Kokot
2025-08-11 02:25:39 +02:00
parent 45b8ebbafd
commit d0a8c0bf1b
3 changed files with 47 additions and 20 deletions

View File

@@ -346,6 +346,9 @@ Deprecated and Removed Features
``xmlrpc``. CDash is the only maintained testing dashboard for CTest,
and it only supports submissions over ``http`` and ``https``.
* The :module:`MacroAddFileDependencies` module is deprecated.
Port projects to use :command:`set_property` directly.
Other Changes
=============

View File

@@ -6,28 +6,38 @@ AddFileDependencies
-------------------
.. deprecated:: 3.20
Do not use this module in new code.
Add dependencies to a source file.
Instead use the :command:`set_property` command to append to the
:prop_sf:`OBJECT_DEPENDS` source file property directly:
.. code-block:: cmake
set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
Load this module in a CMake project with:
.. code-block:: cmake
add_file_dependencies(<source> <files>...)
include(AddFileDependencies)
Adds the given ``<files>`` to the dependencies of file ``<source>``.
Commands
^^^^^^^^
Do not use this command in new code. It is just a wrapper around:
This module provides the following command:
.. code-block:: cmake
.. command:: add_file_dependencies
set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
Adds dependencies to a source file:
Instead use the :command:`set_property` command to append to the
:prop_sf:`OBJECT_DEPENDS` source file property directly.
.. code-block:: cmake
add_file_dependencies(<source> <files>...)
This command adds the given ``<files>`` to the dependencies of file
``<source>``.
#]=======================================================================]
function(add_file_dependencies _file)
set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
endfunction()

View File

@@ -6,24 +6,38 @@ MacroAddFileDependencies
------------------------
.. deprecated:: 3.14
Do not use this module in new code.
Instead use the :command:`set_property` command to append to the
:prop_sf:`OBJECT_DEPENDS` source file property directly:
.. code-block:: cmake
set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
Load this module in a CMake project with:
.. code-block:: cmake
macro_add_file_dependencies(<source> <files>...)
include(MacroAddFileDependencies)
Do not use this command in new code. It is just a wrapper around:
Commands
^^^^^^^^
.. code-block:: cmake
This module provides the following command:
set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
.. command:: macro_add_file_dependencies
Instead use the :command:`set_property` command to append to the
:prop_sf:`OBJECT_DEPENDS` source file property directly.
Adds dependencies to a source file:
.. code-block:: cmake
macro_add_file_dependencies(<source> <files>...)
This command adds the given ``<files>`` to the dependencies of file
``<source>``.
#]=======================================================================]
macro (MACRO_ADD_FILE_DEPENDENCIES _file)
macro(MACRO_ADD_FILE_DEPENDENCIES _file)
set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
endmacro ()
endmacro()