CMP0051.rst 1.0 KB

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