summaryrefslogtreecommitdiffstats
path: root/Help/command/set_source_files_properties.rst
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-04-24 15:42:14 (GMT)
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-05-14 14:31:22 (GMT)
commit3d4b70ea6474c8f29d6b5c057126582dcaad7ea7 (patch)
treed683c5a91d360982f740645dc45765b3b9d52089 /Help/command/set_source_files_properties.rst
parent4dc95526868d903c7f9e9505001cb5dbeec259c0 (diff)
downloadCMake-3d4b70ea6474c8f29d6b5c057126582dcaad7ea7.zip
CMake-3d4b70ea6474c8f29d6b5c057126582dcaad7ea7.tar.gz
CMake-3d4b70ea6474c8f29d6b5c057126582dcaad7ea7.tar.bz2
set_source_files_properties: Allow specification of directory scope
Both set_source_files_properties() and set_property(SOURCE) now accept two new optional arguments: DIRECTORY and TARGET_DIRECTORY. The DIRECTORY option takes a list of relative or absolute paths pointing to processed source directories (add_subdirectory was already called on them). These paths specify directory scopes where the source file properties will be set. Previously the scope was always the currently processed source directory. Similarly TARGET_DIRECTORY takes a list of targets, whose source directories will be used as the list of scopes where to set the source file properties. get_property() and get_source_file_property() also get the same new arguments, except only one value can be specified instead of a list. Fixes: #20128
Diffstat (limited to 'Help/command/set_source_files_properties.rst')
-rw-r--r--Help/command/set_source_files_properties.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index ab95d70..8adfb9e 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -6,12 +6,25 @@ Source files can have properties that affect how they are built.
.. code-block:: cmake
set_source_files_properties([file1 [file2 [...]]]
+ [<TARGET_DIRECTORY ... | DIRECTORY ...>]
PROPERTIES prop1 value1
[prop2 value2 [...]])
Sets properties associated with source files using a key/value paired
list.
+Note that source file properties are by default visible only to
+targets added in the same directory (``CMakeLists.txt``).
+
+The file properties can be made visible in a different directory by specifying
+one of the additional options: ``TARGET_DIRECTORY`` or ``DIRECTORY``.
+
+``DIRECTORY`` takes a list of processed directories paths, and sets the file
+properties in those directory scopes.
+
+``TARGET_DIRECTORY`` takes a list of existing targets. The file
+properties will be set in these targets' directory scopes.
+
See also the :command:`set_property(SOURCE)` command.
See :ref:`Source File Properties` for the list of properties known