Help: Document relation of properties to the rest of the buildsystem.

This commit is contained in:
Stephen Kelly 2014-02-05 14:51:08 +01:00 committed by Brad King
parent ba4c2fa8fd
commit 3879c84782
21 changed files with 204 additions and 145 deletions

View File

@ -3,18 +3,30 @@ COMPILE_DEFINITIONS
Preprocessor definitions for compiling a directory's sources.
The COMPILE_DEFINITIONS property may be set to a semicolon-separated
list of preprocessor definitions using the syntax VAR or VAR=value.
This property specifies the list of options given so far to the
:command:`add_definitions` command.
The ``COMPILE_DEFINITIONS`` property may be set to a semicolon-separated
list of preprocessor definitions using the syntax ``VAR`` or ``VAR=value``.
Function-style definitions are not supported. CMake will
automatically escape the value correctly for the native build system
(note that CMake language syntax may require escapes to specify some
values). This property may be set on a per-configuration basis using
the name COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case
name (ex. "COMPILE_DEFINITIONS_DEBUG"). This property will be
initialized in each directory by its value in the directory's parent.
values).
This property will be initialized in each directory by its value in the
directory's parent.
CMake will automatically drop some definitions that are not supported
by the native build tool. The VS6 IDE does not support definition
values with spaces (but NMake does).
.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
The corresponding :prop_dir:`COMPILE_DEFINITIONS_<CONFIG>` property may
be set to specify per-configuration definitions. Generator expressions
should be preferred instead of setting the alternative property.

View File

@ -3,6 +3,15 @@ COMPILE_DEFINITIONS_<CONFIG>
Per-configuration preprocessor definitions in a directory.
This is the configuration-specific version of COMPILE_DEFINITIONS.
This is the configuration-specific version of :prop_dir:`COMPILE_DEFINITIONS`
where ``<CONFIG>`` is an upper-case name (ex. ``COMPILE_DEFINITIONS_DEBUG``).
This property will be initialized in each directory by its value in
the directory's parent.
Contents of ``COMPILE_DEFINITIONS_<CONFIG>`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
Generator expressions should be preferred instead of setting this property.

View File

@ -3,12 +3,14 @@ COMPILE_OPTIONS
List of options to pass to the compiler.
This property specifies the list of directories given so far for this
property. This property exists on directories and targets.
This property specifies the list of options given so far to the
:command:`add_compile_options` command.
The target property values are used by the generators to set the
options for the compiler.
This property is used to populate the :prop_tgt:`COMPILE_OPTIONS` target
property, which is used by the generators to set the options for the
compiler.
Contents of COMPILE_OPTIONS may use "generator expressions" with the syntax
``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.
Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
for available expressions. See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.

View File

@ -4,15 +4,23 @@ INCLUDE_DIRECTORIES
List of preprocessor include file search directories.
This property specifies the list of directories given so far to the
include_directories command. This property exists on directories and
targets. In addition to accepting values from the include_directories
command, values may be set directly on any directory or any target
using the set_property command. A target gets its initial value for
this property from the value of the directory property. A directory
gets its initial value from its parent directory if it has one. Both
directory and target property values are adjusted by calls to the
include_directories command.
:command:`include_directories` command.
This property is used to populate the :prop_tgt:`INCLUDE_DIRECTORIES`
target property, which is used by the generators to set the include
directories for the compiler.
In addition to accepting values from that command, values may be set
directly on any directory using the :command:`set_property` command. A
directory gets its initial value from its parent directory if it has one.
The intial value of the :prop_tgt:`INCLUDE_DIRECTORIES` target property
comes from the value of this property. Both directory and target property
values are adjusted by calls to the :command:`include_directories` command.
The target property values are used by the generators to set the
include paths for the compiler. See also the include_directories
command.
include paths for the compiler.
Contents of ``INCLUDE_DIRECTORIES`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -3,5 +3,5 @@ ALIASED_TARGET
Name of target aliased by this target.
If this is an ALIAS target, this property contains the name of the
target aliased.
If this is an :ref:`Alias Target <Alias Targets>`, this property contains
the name of the target aliased.

View File

@ -3,17 +3,18 @@ COMPATIBLE_INTERFACE_BOOL
Properties which must be compatible with their link interface
The COMPATIBLE_INTERFACE_BOOL property may contain a list of
propertiesfor this target which must be consistent when evaluated as a
boolean in the INTERFACE of all linked dependees. For example, if a
property "FOO" appears in the list, then for each dependee, the
"INTERFACE_FOO" property content in all of its dependencies must be
consistent with each other, and with the "FOO" property in the
depender. Consistency in this sense has the meaning that if the
property is set, then it must have the same boolean value as all
others, and if the property is not set, then it is ignored. Note that
for each dependee, the set of properties from this property must not
intersect with the set of properties from the
:prop_tgt:`COMPATIBLE_INTERFACE_STRING`,
:prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MIN` or
:prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MAX` property.
The ``COMPATIBLE_INTERFACE_BOOL`` property may contain a list of
properties for this target which must be consistent when evaluated as a
boolean with the ``INTERFACE`` variant of the property in all linked
dependees. For example, if a property ``FOO`` appears in the list, then
for each dependee, the ``INTERFACE_FOO`` property content in all of its
dependencies must be consistent with each other, and with the ``FOO``
property in the depender.
Consistency in this sense has the meaning that if the property is set,
then it must have the same boolean value as all others, and if the
property is not set, then it is ignored.
Note that for each dependee, the set of properties specified in this
property must not intersect with the set specified in any of the other
:ref:`Compatible Interface Properties`.

View File

@ -3,15 +3,16 @@ COMPATIBLE_INTERFACE_NUMBER_MAX
Properties whose maximum value from the link interface will be used.
The COMPATIBLE_INTERFACE_NUMBER_MAX property may contain a list of
properties for this target whose maximum value may be read at generate time
when evaluated in the INTERFACE of all linked dependees. For example, if a
property "FOO" appears in the list, then for each dependee, the
"INTERFACE_FOO" property content in all of its dependencies will be compared
with each other and with the "FOO" property in the depender. When reading
the FOO property at generate time, the maximum value will be returned.
If the property is not set, then it is ignored. Note that for each
dependee, the set of properties from this property must not intersect
with the set of properties from the :prop_tgt:`COMPATIBLE_INTERFACE_BOOL`,
:prop_tgt:`COMPATIBLE_INTERFACE_STRING` or
:prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MIN` property.
The ``COMPATIBLE_INTERFACE_NUMBER_MAX`` property may contain a list of
properties for this target whose maximum value may be read at generate
time when evaluated in the ``INTERFACE`` variant of the property in all
linked dependees. For example, if a property ``FOO`` appears in the list,
then for each dependee, the ``INTERFACE_FOO`` property content in all of
its dependencies will be compared with each other and with the ``FOO``
property in the depender. When reading the ``FOO`` property at generate
time, the maximum value will be returned. If the property is not set,
then it is ignored.
Note that for each dependee, the set of properties specified in this
property must not intersect with the set specified in any of the other
:ref:`Compatible Interface Properties`.

View File

@ -3,15 +3,16 @@ COMPATIBLE_INTERFACE_NUMBER_MIN
Properties whose maximum value from the link interface will be used.
The COMPATIBLE_INTERFACE_NUMBER_MIN property may contain a list of
properties for this target whose minimum value may be read at generate time
when evaluated in the INTERFACE of all linked dependees. For example, if a
property "FOO" appears in the list, then for each dependee, the
"INTERFACE_FOO" property content in all of its dependencies will be compared
with each other and with the "FOO" property in the depender. When reading
the FOO property at generate time, the minimum value will be returned.
If the property is not set, then it is ignored. Note that for each
dependee, the set of properties from this property must not intersect
with the set of properties from the :prop_tgt:`COMPATIBLE_INTERFACE_BOOL`,
:prop_tgt:`COMPATIBLE_INTERFACE_STRING` or
:prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MAX` property.
The ``COMPATIBLE_INTERFACE_NUMBER_MIN`` property may contain a list of
properties for this target whose minimum value may be read at generate
time when evaluated in the ``INTERFACE`` variant of the property of all
linked dependees. For example, if a
property ``FOO`` appears in the list, then for each dependee, the
``INTERFACE_FOO`` property content in all of its dependencies will be
compared with each other and with the ``FOO`` property in the depender.
When reading the ``FOO`` property at generate time, the minimum value
will be returned. If the property is not set, then it is ignored.
Note that for each dependee, the set of properties specified in this
property must not intersect with the set specified in any of the other
:ref:`Compatible Interface Properties`.

View File

@ -3,14 +3,14 @@ COMPATIBLE_INTERFACE_STRING
Properties which must be string-compatible with their link interface
The COMPATIBLE_INTERFACE_STRING property may contain a list of
The ``COMPATIBLE_INTERFACE_STRING`` property may contain a list of
properties for this target which must be the same when evaluated as a
string in the INTERFACE of all linked dependees. For example, if a
property "FOO" appears in the list, then for each dependee, the
"INTERFACE_FOO" property content in all of its dependencies must be
equal with each other, and with the "FOO" property in the depender.
If the property is not set, then it is ignored. Note that for each
dependee, the set of properties from this property must not intersect
with the set of properties from the :prop_tgt:`COMPATIBLE_INTERFACE_BOOL`,
:prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MIN` or
:prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MAX` property.
string in the ``INTERFACE`` variant of the property all linked dependees.
For example, if a property ``FOO`` appears in the list, then for each
dependee, the ``INTERFACE_FOO`` property content in all of its
dependencies must be equal with each other, and with the ``FOO`` property
in the depender. If the property is not set, then it is ignored.
Note that for each dependee, the set of properties specified in this
property must not intersect with the set specified in any of the other
:ref:`Compatible Interface Properties`.

View File

@ -3,21 +3,24 @@ COMPILE_DEFINITIONS
Preprocessor definitions for compiling a target's sources.
The COMPILE_DEFINITIONS property may be set to a semicolon-separated
list of preprocessor definitions using the syntax VAR or VAR=value.
The ``COMPILE_DEFINITIONS`` property may be set to a semicolon-separated
list of preprocessor definitions using the syntax ``VAR`` or ``VAR=value``.
Function-style definitions are not supported. CMake will
automatically escape the value correctly for the native build system
(note that CMake language syntax may require escapes to specify some
values). This property may be set on a per-configuration basis using
the name COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case
name (ex. "COMPILE_DEFINITIONS_DEBUG").
values).
CMake will automatically drop some definitions that are not supported
by the native build tool. The VS6 IDE does not support definition
values with spaces (but NMake does).
Contents of COMPILE_DEFINITIONS may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
for available expressions.
.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
for available expressions. See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.
The corresponding :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` property may
be set to specify per-configuration definitions. Generator expressions
should be preferred instead of setting the alternative property.

View File

@ -3,4 +3,12 @@ COMPILE_DEFINITIONS_<CONFIG>
Per-configuration preprocessor definitions on a target.
This is the configuration-specific version of COMPILE_DEFINITIONS.
This is the configuration-specific version of :prop_tgt:`COMPILE_DEFINITIONS`
where ``<CONFIG>`` is an upper-case name (ex. ``COMPILE_DEFINITIONS_DEBUG``).
Contents of ``COMPILE_DEFINITIONS_<CONFIG>`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
Generator expressions should be preferred instead of setting this property.

View File

@ -4,11 +4,13 @@ COMPILE_OPTIONS
List of options to pass to the compiler.
This property specifies the list of options specified so far for this
property. This property exists on directories and targets.
property.
The target property values are used by the generators to set the
options for the compiler.
This property is intialized by the :prop_dir:`COMPILE_OPTIONS` directory
property, which is used by the generators to set the options for the
compiler.
Contents of COMPILE_OPTIONS may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.
Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
for available expressions. See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.

View File

@ -4,22 +4,21 @@ INCLUDE_DIRECTORIES
List of preprocessor include file search directories.
This property specifies the list of directories given so far to the
include_directories command. This property exists on directories and
targets. In addition to accepting values from the :command:`include_directories`
command, values may be set directly on any directory or any target
using the :command:`set_property` command. A target gets its initial value for
this property from the value of the directory property. A directory
gets its initial value from its parent directory if it has one. Both
directory and target property values are adjusted by calls to the
:command:`target_include_directories` command. In addition to accepting
values from that command, values may be set directly on any
target using the :command:`set_property` command. A target gets its
initial value for this property from the value of the
:prop_dir:`INCLUDE_DIRECTORIES` directory property. Both directory and
target property values are adjusted by calls to the
:command:`include_directories` command.
The target property values are used by the generators to set the
include paths for the compiler. See also the :command:`include_directories`
and :command:`target_include_directories` commands.
The value of this property is used by the generators to set the include
paths for the compiler.
Relative paths should not be added to this property directly. Use one of
the commands above instead to handle relative paths.
Contents of INCLUDE_DIRECTORIES may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.
Contents of ``INCLUDE_DIRECTORIES`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -5,9 +5,11 @@ List of public compile definitions for a library.
Targets may populate this property to publish the compile definitions
required to compile against the headers for the target. Consuming
targets can add entries to their own COMPILE_DEFINITIONS property such
as $<TARGET_PROPERTY:foo,INTERFACE_COMPILE_DEFINITIONS> to use the
compile definitions specified in the interface of 'foo'.
targets can add entries to their own :prop_tgt:`COMPILE_DEFINITIONS`
property such as ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_DEFINITIONS>``
to use the compile definitions specified in the interface of ``foo``.
This property also supports generator expressions. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
Contents of ``INTERFACE_COMPILE_DEFINITIONS`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -5,9 +5,11 @@ List of interface options to pass to the compiler.
Targets may populate this property to publish the compile options
required to compile against the headers for the target. Consuming
targets can add entries to their own COMPILE_OPTIONS property such as
$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_OPTIONS> to use the compile
options specified in the interface of 'foo'.
targets can add entries to their own :prop_tgt:`COMPILE_OPTIONS` property
such as ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_OPTIONS>`` to use the
compile options specified in the interface of ``foo``.
This property also supports generator expressions. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
Contents of ``INTERFACE_COMPILE_OPTIONS`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -5,9 +5,11 @@ List of public include directories for a library.
Targets may populate this property to publish the include directories
required to compile against the headers for the target. Consuming
targets can add entries to their own INCLUDE_DIRECTORIES property such
as $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES> to use the
include directories specified in the interface of 'foo'.
targets can add entries to their own :prop_tgt:`INCLUDE_DIRECTORIES`
property such as ``$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>``
to use the include directories specified in the interface of ``foo``.
This property also supports generator expressions. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
Contents of ``INTERFACE_INCLUDE_DIRECTORIES`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -7,8 +7,11 @@ This property contains the list of transitive link dependencies. When
the target is linked into another target the libraries listed (and
recursively their link interface libraries) will be provided to the
other target also. This property is overridden by the
LINK_INTERFACE_LIBRARIES or LINK_INTERFACE_LIBRARIES_<CONFIG> property
if policy CMP0022 is OLD or unset.
:prop_tgt:`LINK_INTERFACE_LIBRARIES` or
:prop_tgt:`LINK_INTERFACE_LIBRARIES_<CONFIG>` property if policy
:policy:`CMP0022` is ``OLD`` or unset.
This property also supports generator expressions. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
Contents of ``INTERFACE_LINK_LIBRARIES`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

View File

@ -3,13 +3,14 @@ INTERFACE_POSITION_INDEPENDENT_CODE
Whether consumers need to create a position-independent target
The INTERFACE_POSITION_INDEPENDENT_CODE property informs consumers of
this target whether they must set their POSITION_INDEPENDENT_CODE
property to ON. If this property is set to ON, then the
POSITION_INDEPENDENT_CODE property on all consumers will be set to ON.
Similarly, if this property is set to OFF, then the
POSITION_INDEPENDENT_CODE property on all consumers will be set to
OFF. If this property is undefined, then consumers will determine
their POSITION_INDEPENDENT_CODE property by other means. Consumers
The ``INTERFACE_POSITION_INDEPENDENT_CODE`` property informs consumers of
this target whether they must set their
:prop_tgt:`POSITION_INDEPENDENT_CODE` property to ``ON``. If this
property is set to ``ON``, then the :prop_tgt:`POSITION_INDEPENDENT_CODE`
property on all consumers will be set to ``ON``. Similarly, if this
property is set to ``OFF``, then the :prop_tgt:`POSITION_INDEPENDENT_CODE`
property on all consumers will be set to ``OFF``. If this property is
undefined, then consumers will determine their
:prop_tgt:`POSITION_INDEPENDENT_CODE` property by other means. Consumers
must ensure that the targets that they link to have a consistent
requirement for their INTERFACE_POSITION_INDEPENDENT_CODE property.
requirement for their ``INTERFACE_POSITION_INDEPENDENT_CODE`` property.

View File

@ -8,5 +8,8 @@ which contain system headers, and therefore should not result in
compiler warnings. Consuming targets will then mark the same include
directories as system headers.
This property also supports generator expressions. See the
Contents of ``INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`` may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
See the :manual:`cmake-buildsystem(7)` manual for more on defining
buildsystem properties.

View File

@ -5,13 +5,13 @@ List of direct link dependencies.
This property specifies the list of libraries or targets which will be
used for linking. In addition to accepting values from the
target_link_libraries command, values may be set directly on any
target using the set_property command.
:command:`target_link_libraries` command, values may be set directly on
any target using the :command:`set_property` command.
The target property values are used by the generators to set the link
libraries for the compiler. See also the target_link_libraries
command.
The value of this property is used by the generators to set the link
libraries for the compiler.
Contents of LINK_LIBRARIES may use "generator expressions" with the syntax
``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for
available expressions.
Contents of ``LINK_LIBRARIES`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
for available expressions. See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.

View File

@ -3,9 +3,9 @@ POSITION_INDEPENDENT_CODE
Whether to create a position-independent target
The POSITION_INDEPENDENT_CODE property determines whether position
The ``POSITION_INDEPENDENT_CODE`` property determines whether position
independent executables or shared libraries will be created. This
property is true by default for SHARED and MODULE library targets and
false otherwise. This property is initialized by the value of the
variable CMAKE_POSITION_INDEPENDENT_CODE if it is set when a target is
created.
property is ``True`` by default for ``SHARED`` and ``MODULE`` library
targets and ``False`` otherwise. This property is initialized by the value
of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set
when a target is created.