CMP0192.rst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. CMP0192
  2. -------
  3. .. versionadded:: 4.1
  4. :module:`GNUInstallDirs` uses absolute ``SYSCONFDIR``, ``LOCALSTATEDIR``,
  5. and ``RUNSTATEDIR`` in special prefixes.
  6. The :module:`GNUInstallDirs` module documents
  7. :ref:`special cases <GNUInstallDirs special cases>`
  8. for ``SYSCONFDIR``, ``LOCALSTATEDIR``, and ``RUNSTATEDIR``.
  9. When :variable:`CMAKE_INSTALL_PREFIX` is a special prefix, e.g., ``/usr``,
  10. the absolute paths for these directories may be outside the prefix, e.g.,
  11. ``/etc``, ``/var``, and ``/var/run``.
  12. In CMake 4.0 and below, the default values for the ``CMAKE_INSTALL_<dir>``
  13. variables, for ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR``, and
  14. ``RUNSTATEDIR``, always used relative paths (``etc``, ``var``, ``var/run``),
  15. and the special cases were implemented only when computing absolute paths
  16. for the ``CMAKE_INSTALL_FULL_<dir>`` variables.
  17. CMake 4.1 and above prefer to default ``CMAKE_INSTALL_<dir>`` variables to
  18. absolute paths, for ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR``,
  19. and ``RUNSTATEDIR``, when :variable:`CMAKE_INSTALL_PREFIX` is a special
  20. prefix. This policy provides compatibility for projects that have not
  21. been updated to expect this behavior.
  22. The ``OLD`` behavior for this policy is to default ``CMAKE_INSTALL_<dir>``
  23. variables to relative paths. The ``NEW`` behavior for this policy is to
  24. default ``CMAKE_INSTALL_<dir>`` variables to absolute paths, for ``<dir>``
  25. equal to ``SYSCONFDIR``, ``LOCALSTATEDIR``, and ``RUNSTATEDIR``, when
  26. :variable:`CMAKE_INSTALL_PREFIX` is a special prefix.
  27. This policy takes effect at the first call of ``include(GNUInstallDirs)``.
  28. Subsequent calls of ``include(GNUInstallDirs)`` reuse cached
  29. ``CMAKE_INSTALL_<dir>`` values from the first call.
  30. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
  31. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  32. .. include:: include/STANDARD_ADVICE.rst
  33. .. include:: include/DEPRECATED.rst