cmake/Help/command/set_target_properties.rst
Arha Gatram a121419908
ALIAS: Add support for set_property and set_target_properties commands
Currently, getting properties from an ALIAS target retrieves the property
from the target which the alias references while setting properties results
in an error. This relaxes set_property and set_target_properties to
accept ALIAS targets and act on the referenced target, mirroring the get
behavior.

An error is raised when setting ALIAS_GLOBAL or ALIASED_TARGET on an ALIAS
target.

Closes: #19445
2026-07-07 07:32:27 -07:00

29 lines
912 B
ReStructuredText

set_target_properties
---------------------
Targets can have properties that affect how they are built.
.. code-block:: cmake
set_target_properties(<targets> ...
PROPERTIES <prop1> <value1>
[<prop2> <value2>] ...)
Sets properties on targets. The syntax for the command is to list all
the targets you want to change, and then provide the values you want to
set next. You can use any prop value pair you want and extract it
later with the :command:`get_property` or :command:`get_target_property`
command.
.. versionchanged:: 4.5
If ``<targets>`` contains :ref:`Alias Targets`, properties are set on the
corresponding target referenced by each alias.
See Also
^^^^^^^^
* :command:`define_property`
* :command:`get_target_property`
* the more general :command:`set_property` command
* :ref:`Target Properties` for the list of properties known to CMake