blob: ca60b5702df67c63788e5e3af22dc37bcf38030e [file] [log] [blame]
Haibo Huangd00577c2020-02-28 16:35:48 -08001# 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:
5MacroAddFileDependencies
6------------------------
7
8MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
9
10Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
11are usually better ways to specify the correct dependencies.
12
13MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
14convenience wrapper around the OBJECT_DEPENDS source file property.
15You can just use set_property(SOURCE <file> APPEND PROPERTY
16OBJECT_DEPENDS depend_files) instead.
17#]=======================================================================]
18
19macro (MACRO_ADD_FILE_DEPENDENCIES _file)
20
21 get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
22 if (_deps)
23 set(_deps ${_deps} ${ARGN})
24 else ()
25 set(_deps ${ARGN})
26 endif ()
27
28 set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
29
30endmacro ()