CMP0193.rst 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. CMP0193
  2. -------
  3. .. versionadded:: 4.1
  4. :module:`GNUInstallDirs` caches ``CMAKE_INSTALL_*`` with leading ``usr/`` for
  5. install prefix ``/``.
  6. When :variable:`CMAKE_INSTALL_PREFIX` is ``/``, the ``CMAKE_INSTALL_<dir>``
  7. variables, for ``<dir>`` equal to ``BINDIR``, ``SBINDIR``, ``LIBEXECDIR``,
  8. ``SHAREDSTATEDIR``, ``INCLUDEDIR``, ``OLDINCLUDEDIR``, ``DATAROOTDIR``, and
  9. ``LIBDIR``, are prepended with a leading ``usr/`` as documented among the
  10. :ref:`special cases <GNUInstallDirs special cases>`.
  11. In CMake 4.0 and below, these ``CMAKE_INSTALL_<dir>`` variables were cached
  12. without their leading ``usr/``, and it was prepended in normal variables that
  13. shadow their cache entries.
  14. CMake 4.1 and above prefer to cache ``CMAKE_INSTALL_<dir>`` with their leading
  15. ``usr/``. Consequently, the :command:`GNUInstallDirs_get_absolute_install_dir`
  16. command no longer alters the relative input variable argument ``<input-var>``.
  17. This policy provides compatibility for projects that have not been updated to
  18. expect the new behavior.
  19. The ``OLD`` behavior for this policy is to cache ``CMAKE_INSTALL_<dir>``
  20. variables without the leading ``usr/``. The ``NEW`` behavior for this
  21. policy is to cache ``CMAKE_INSTALL_<dir>`` variables with the leading ``usr/``.
  22. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
  23. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  24. .. include:: include/STANDARD_ADVICE.rst
  25. .. include:: include/DEPRECATED.rst