CMake/Help/policy/CMP0051.rst
Brad King 482a3bf3f0 Help: Document explicitly that policy OLD behavior is deprecated
The most likely documentation page a project author will read in
response to a policy warning is the page for the policy itself.
Add to every policy documentation page a note explicitly stating
that the OLD behavior is deprecated.  Also mention this in the
cmake_policy() command documentation that explains how to set a
policy to OLD.

Suggested-by: Fraser Hutchison <fraser.hutchison@gmail.com>
2015-06-09 09:29:41 -04:00

27 lines
1.0 KiB
ReStructuredText

CMP0051
-------
List TARGET_OBJECTS in SOURCES target property.
CMake 3.0 and lower did not include the ``TARGET_OBJECTS``
:manual:`generator expression <cmake-generator-expressions(7)>` when
returning the :prop_tgt:`SOURCES` target property.
Configure-time CMake code is not able to handle generator expressions. If
using the :prop_tgt:`SOURCES` target property at configure time, it may be
necessary to first remove generator expressions using the
:command:`string(GENEX_STRIP)` command. Generate-time CMake code such as
:command:`file(GENERATE)` can handle the content without stripping.
The ``OLD`` behavior for this policy is to omit ``TARGET_OBJECTS``
expressions from the :prop_tgt:`SOURCES` target property. The ``NEW``
behavior for this policy is to include ``TARGET_OBJECTS`` expressions
in the output.
This policy was introduced in CMake version 3.1.
CMake version |release| warns when the policy is not set and uses
``OLD`` behavior. Use the :command:`cmake_policy` command to set it
to ``OLD`` or ``NEW`` explicitly.
.. include:: DEPRECATED.txt