CMP0051.rst 1.1 KB

12345678910111213141516171819202122232425262728
  1. CMP0051
  2. -------
  3. .. versionadded:: 3.1
  4. List :genex:`TARGET_OBJECTS` in SOURCES target property.
  5. CMake 3.0 and lower did not include the ``TARGET_OBJECTS``
  6. :manual:`generator expression <cmake-generator-expressions(7)>` when
  7. returning the :prop_tgt:`SOURCES` target property.
  8. Configure-time CMake code is not able to handle generator expressions. If
  9. using the :prop_tgt:`SOURCES` target property at configure time, it may be
  10. necessary to first remove generator expressions using the
  11. :command:`string(GENEX_STRIP)` command. Generate-time CMake code such as
  12. :command:`file(GENERATE)` can handle the content without stripping.
  13. The ``OLD`` behavior for this policy is to omit ``TARGET_OBJECTS``
  14. expressions from the :prop_tgt:`SOURCES` target property. The ``NEW``
  15. behavior for this policy is to include ``TARGET_OBJECTS`` expressions
  16. in the output.
  17. This policy was introduced in CMake version 3.1.
  18. CMake version |release| warns when the policy is not set and uses
  19. ``OLD`` behavior. Use the :command:`cmake_policy` command to set it
  20. to ``OLD`` or ``NEW`` explicitly.
  21. .. include:: DEPRECATED.txt