https://github.com/Kitware/CMake
Revision f3a6b4a209674ee1b3d7fa6f0724c2828fbe23e8 authored by Stephan Rohmen on 21 July 2020, 17:47:34 UTC, committed by Brad King on 21 July 2020, 18:55:44 UTC
1 parent 93549b9
Raw File
Tip revision: f3a6b4a209674ee1b3d7fa6f0724c2828fbe23e8 authored by Stephan Rohmen on 21 July 2020, 17:47:34 UTC
Tests: Cover Graphviz support for per-target dependency graph options
Tip revision: f3a6b4a
AddFileDependencies.cmake
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
AddFileDependencies
-------------------

Add dependencies to a source file.

.. code-block:: cmake

  ADD_FILE_DEPENDENCIES(<source> <files>)

Adds the given ``<files>`` to the dependencies of file ``<source>``.
#]=======================================================================]

macro(ADD_FILE_DEPENDENCIES _file)

  get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
  if (_deps)
    set(_deps ${_deps} ${ARGN})
  else ()
    set(_deps ${ARGN})
  endif ()

  set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")

endmacro()
back to top