summaryrefslogtreecommitdiff
path: root/Modules/AddFileDependencies.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/AddFileDependencies.cmake')
-rw-r--r--Modules/AddFileDependencies.cmake27
1 files changed, 16 insertions, 11 deletions
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index 598a52fa9..13b2600f9 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -5,24 +5,29 @@
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>``.
-#]=======================================================================]
-macro(ADD_FILE_DEPENDENCIES _file)
+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.
+
+#]=======================================================================]
- get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
- if (_deps)
- set(_deps ${_deps} ${ARGN})
- else ()
- set(_deps ${ARGN})
- endif ()
+function(add_file_dependencies _file)
- set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
+ set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
-endmacro()
+endfunction()