CMP0062.rst 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. CMP0062
  2. -------
  3. .. versionadded:: 3.3
  4. Disallow :command:`install` of :command:`export` result.
  5. The :command:`export()` command generates a file containing
  6. :ref:`Imported Targets`, which is suitable for use from the build
  7. directory. It is not suitable for installation because it contains absolute
  8. paths to buildsystem locations, and is particular to a single build
  9. configuration.
  10. The :command:`install(EXPORT)` generates and installs files which contain
  11. :ref:`Imported Targets`. These files are generated with relative paths
  12. (unless the user specifies absolute paths), and are designed for
  13. multi-configuration use. See :ref:`Creating Packages` for more.
  14. CMake 3.3 no longer allows the use of the :command:`install(FILES)` command
  15. with the result of the :command:`export()` command.
  16. The ``OLD`` behavior for this policy is to allow installing the result of
  17. an :command:`export()` command. The ``NEW`` behavior for this policy is
  18. not to allow installing the result of an :command:`export()` command.
  19. This policy was introduced in CMake version 3.3. CMake version
  20. |release| warns when the policy is not set and uses ``OLD`` behavior. Use
  21. the :command:`cmake_policy()` command to set it to ``OLD`` or ``NEW``
  22. explicitly.
  23. .. include:: DEPRECATED.txt