AddFileDependencies.cmake 953 B

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