AddFileDependencies.cmake 784 B

12345678910111213141516171819202122232425262728
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. AddFileDependencies
  5. -------------------
  6. Add dependencies to a source file.
  7. .. code-block:: cmake
  8. ADD_FILE_DEPENDENCIES(<source> <files>)
  9. Adds the given ``<files>`` to the dependencies of file ``<source>``.
  10. #]=======================================================================]
  11. macro(ADD_FILE_DEPENDENCIES _file)
  12. get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
  13. if (_deps)
  14. set(_deps ${_deps} ${ARGN})
  15. else ()
  16. set(_deps ${ARGN})
  17. endif ()
  18. set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
  19. endmacro()