1# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2# file Copyright.txt or https://cmake.org/licensing for details.
3
4#[=======================================================================[.rst:
5AddFileDependencies
6-------------------
7
8.. deprecated:: 3.20
9
10Add dependencies to a source file.
11
12.. code-block:: cmake
13
14  add_file_dependencies(<source> <files>...)
15
16Adds the given ``<files>`` to the dependencies of file ``<source>``.
17
18Do not use this command in new code.  It is just a wrapper around:
19
20.. code-block:: cmake
21
22  set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
23
24Instead use the :command:`set_property` command to append to the
25:prop_sf:`OBJECT_DEPENDS` source file property directly.
26
27#]=======================================================================]
28
29function(add_file_dependencies _file)
30
31  set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
32
33endfunction()
34