CMP0026.rst 1.3 KB

1234567891011121314151617181920212223242526272829
  1. CMP0026
  2. -------
  3. Disallow use of the LOCATION property for build targets.
  4. CMake 2.8.12 and lower allowed reading the :prop_tgt:`LOCATION` target
  5. property (and configuration-specific variants) to
  6. determine the eventual location of build targets. This relies on the
  7. assumption that all necessary information is available at
  8. configure-time to determine the final location and filename of the
  9. target. However, this property is not fully determined until later at
  10. generate-time. At generate time, the ``$<TARGET_FILE>`` generator
  11. expression can be used to determine the eventual :prop_tgt:`LOCATION` of a target
  12. output.
  13. Code which reads the :prop_tgt:`LOCATION` target property can be ported to
  14. use the ``$<TARGET_FILE>`` generator expression together with the
  15. :command:`file(GENERATE)` subcommand to generate a file containing
  16. the target location.
  17. The ``OLD`` behavior for this policy is to allow reading the :prop_tgt:`LOCATION`
  18. properties from build-targets. The ``NEW`` behavior for this policy is to
  19. not to allow reading the :prop_tgt:`LOCATION` properties from build-targets.
  20. This policy was introduced in CMake version 3.0. CMake version
  21. |release| warns when the policy is not set and uses ``OLD`` behavior. Use
  22. the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
  23. .. include:: DEPRECATED.txt