Commit 17d41381 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'AddFileDependencies-simplify'

0f6fc388

 AddFileDependencies: Avoid leaking temporary variable
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !5779
parents 326cceaa 0f6fc388
Pipeline #213288 failed with stages
in 33 minutes and 11 seconds
......@@ -9,20 +9,13 @@ Add dependencies to a source file.
.. code-block:: cmake
ADD_FILE_DEPENDENCIES(<source> <files>)
add_file_dependencies(<source> <files>)
Adds the given ``<files>`` to the dependencies of file ``<source>``.
#]=======================================================================]
macro(ADD_FILE_DEPENDENCIES _file)
function(add_file_dependencies _file)
get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
if (_deps)
set(_deps ${_deps} ${ARGN})
else ()
set(_deps ${ARGN})
endif ()
set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
endmacro()
endfunction()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment