MacroAddFileDependencies.cmake 927 B

1234567891011121314151617181920212223242526272829
  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. # MacroAddFileDependencies
  5. # ------------------------
  6. #
  7. # MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
  8. #
  9. # Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
  10. # are usually better ways to specify the correct dependencies.
  11. #
  12. # MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
  13. # convenience wrapper around the OBJECT_DEPENDS source file property.
  14. # You can just use set_property(SOURCE <file> APPEND PROPERTY
  15. # OBJECT_DEPENDS depend_files) instead.
  16. macro (MACRO_ADD_FILE_DEPENDENCIES _file)
  17. get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
  18. if (_deps)
  19. set(_deps ${_deps} ${ARGN})
  20. else ()
  21. set(_deps ${ARGN})
  22. endif ()
  23. set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
  24. endmacro ()