cmake/Modules/AddFileDependencies.cmake

34 lines
955 B
CMake
Raw Normal View History

2016-10-30 18:24:19 +01:00
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
2019-11-11 23:01:05 +01:00
#[=======================================================================[.rst:
AddFileDependencies
-------------------
2021-09-14 00:13:48 +02:00
.. deprecated:: 3.20
2019-11-11 23:01:05 +01:00
Add dependencies to a source file.
.. code-block:: cmake
2021-09-14 00:13:48 +02:00
add_file_dependencies(<source> <files>...)
2019-11-11 23:01:05 +01:00
Adds the given ``<files>`` to the dependencies of file ``<source>``.
2021-09-14 00:13:48 +02:00
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.
#]=======================================================================]
2021-09-14 00:13:48 +02:00
function(add_file_dependencies _file)
2021-09-14 00:13:48 +02:00
set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
2021-09-14 00:13:48 +02:00
endfunction()