CMP0177.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. CMP0177
  2. -------
  3. .. versionadded:: 3.31
  4. :command:`install` ``DESTINATION`` paths are normalized.
  5. The :command:`install` command has a number of different forms, and most of
  6. them take a ``DESTINATION`` keyword, some in more than one place.
  7. CMake 3.30 and earlier used the value given after the ``DESTINATION`` keyword
  8. as provided with no transformations. The :command:`install(EXPORT)` form
  9. assumes the path contains no ``..`` or ``.`` path components when computing
  10. a path relative to the ``DESTINATION``, and if the project provided a path
  11. that violated that assumption, the computed path would be incorrect.
  12. CMake 3.31 normalizes all ``DESTINATION`` values given in any form of the
  13. :command:`install` command, except for the ``INCLUDES DESTINATION`` of the
  14. :command:`install(TARGETS)` form. The normalization performed is the same
  15. as for the :command:`cmake_path` command (see :ref:`Normalization`).
  16. The ``OLD`` behavior of this policy performs no translation on the
  17. ``DESTINATION`` values of any :command:`install` command. They are used
  18. exactly as provided. If a destination path contains ``..`` or ``.`` path
  19. components, :command:`install(EXPORT)` will use the same wrong paths as
  20. CMake 3.30 and earlier.
  21. The ``NEW`` behavior will normalize all ``DESTINATION`` values except for
  22. ``INCLUDES DESTINATION``. If a destination path contains a generator
  23. expression, it will be wrapped in a ``$<PATH:CMAKE_PATH,NORMALIZE,...>``
  24. generator expression.
  25. This policy was introduced in CMake version 3.31.
  26. It may be set by :command:`cmake_policy` or :command:`cmake_minimum_required`.
  27. If it is not set, CMake will warn if it detects a path that would be different
  28. if normalized, and uses ``OLD`` behavior. If a destination path contains a
  29. generator expression, no such warning will be issued regardless of the value.
  30. .. include:: include/DEPRECATED.rst