Browse Source

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.
Peter Kokot 3 months ago
parent
commit
d0a8c0bf1b
3 changed files with 47 additions and 20 deletions
  1. 3 0
      Help/release/3.14.rst
  2. 20 10
      Modules/AddFileDependencies.cmake
  3. 24 10
      Modules/MacroAddFileDependencies.cmake

+ 3 - 0
Help/release/3.14.rst

@@ -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
 =============
 

+ 20 - 10
Modules/AddFileDependencies.cmake

@@ -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()

+ 24 - 10
Modules/MacroAddFileDependencies.cmake

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