summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-09 13:19:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-02-09 13:19:28 (GMT)
commit54f15cbb9955b1c9e994108391cc44852f5e794e (patch)
tree36973b8ac69cdf9a5c85976ed0d95dd23bf84ba9
parentf7dd651ca7aa4dab1442d6c3e97586d134290844 (diff)
parent9cddaad9409506a616be65df43a7abb6d82f3345 (diff)
downloadCMake-54f15cbb9955b1c9e994108391cc44852f5e794e.zip
CMake-54f15cbb9955b1c9e994108391cc44852f5e794e.tar.gz
CMake-54f15cbb9955b1c9e994108391cc44852f5e794e.tar.bz2
Merge topic 'AddFileDependencies-deprecate'
9cddaad940 AddFileDependencies: Deprecate this unnecessary module 4841d38a7a MacroAddFileDependencies: Explicitly deprecate by documentation 777c14af82 MacroAddFileDependencies: Simplify implementation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5788
-rw-r--r--Help/manual/cmake-modules.7.rst2
-rw-r--r--Help/release/dev/AddFileDependencies-deprecate.rst5
-rw-r--r--Modules/AddFileDependencies.cmake14
-rw-r--r--Modules/MacroAddFileDependencies.cmake29
4 files changed, 33 insertions, 17 deletions
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index e108bc3..17c1a1e 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -15,7 +15,6 @@ These modules are loaded using the :command:`include` command.
.. toctree::
:maxdepth: 1
- /module/AddFileDependencies
/module/AndroidTestUtilities
/module/BundleUtilities
/module/CheckCCompilerFlag
@@ -272,6 +271,7 @@ Deprecated Utility Modules
.. toctree::
:maxdepth: 1
+ /module/AddFileDependencies
/module/CMakeDetermineVSServicePack
/module/CMakeExpandImportedTargets
/module/CMakeForceCompiler
diff --git a/Help/release/dev/AddFileDependencies-deprecate.rst b/Help/release/dev/AddFileDependencies-deprecate.rst
new file mode 100644
index 0000000..d3946a5
--- /dev/null
+++ b/Help/release/dev/AddFileDependencies-deprecate.rst
@@ -0,0 +1,5 @@
+AddFileDependencies-deprecate
+-----------------------------
+
+* The :module:`AddFileDependencies` module is deprecated.
+ Port projects to use :command:`set_property` directly.
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index c038858..13b2600 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -5,13 +5,25 @@
AddFileDependencies
-------------------
+.. deprecated:: 3.20
+
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>``.
+
+Do not use this command in new code. It is just a wrapper around:
+
+.. code-block:: cmake
+
+ set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
+
+Instead use the :command:`set_property` command to append to the
+:prop_sf:`OBJECT_DEPENDS` source file property directly.
+
#]=======================================================================]
function(add_file_dependencies _file)
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index ca60b57..8fdc264 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -5,26 +5,25 @@
MacroAddFileDependencies
------------------------
-MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
+.. deprecated:: 3.14
-Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
-are usually better ways to specify the correct dependencies.
+::
+
+ MACRO_ADD_FILE_DEPENDENCIES(<source> <files>...)
+
+Do not use this command in new code. It is just a wrapper around:
+
+.. code-block:: cmake
+
+ set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
+
+Instead use the :command:`set_property` command to append to the
+:prop_sf:`OBJECT_DEPENDS` source file property directly.
-MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
-convenience wrapper around the OBJECT_DEPENDS source file property.
-You can just use set_property(SOURCE <file> APPEND PROPERTY
-OBJECT_DEPENDS depend_files) instead.
#]=======================================================================]
macro (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}")
+ set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
endmacro ()