CMP0095.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. CMP0095
  2. -------
  3. .. versionadded:: 3.16
  4. ``RPATH`` entries are properly escaped in the intermediary CMake install script.
  5. In CMake 3.15 and earlier, ``RPATH`` entries set via
  6. :variable:`CMAKE_INSTALL_RPATH` or via :prop_tgt:`INSTALL_RPATH` have not been
  7. escaped before being inserted into the ``cmake_install.cmake`` script. Dynamic
  8. linkers on ELF-based systems (e.g. Linux and FreeBSD) allow certain keywords in
  9. ``RPATH`` entries, such as ``${ORIGIN}`` (More details are available in the
  10. ``ld.so`` man pages on those systems). The syntax of these keywords can match
  11. CMake's variable syntax. In order to not be substituted (usually to an empty
  12. string) already by the intermediary ``cmake_install.cmake`` script, the user had
  13. to double-escape such ``RPATH`` keywords, e.g.
  14. ``set(CMAKE_INSTALL_RPATH "\\\${ORIGIN}/../lib")``. Since the intermediary
  15. ``cmake_install.cmake`` script is an implementation detail of CMake, CMake 3.16
  16. and later will make sure ``RPATH`` entries are inserted literally by escaping
  17. any coincidental CMake syntax.
  18. The ``OLD`` behavior of this policy is to not escape ``RPATH`` entries in the
  19. intermediary ``cmake_install.cmake`` script. The ``NEW`` behavior is to properly
  20. escape coincidental CMake syntax in ``RPATH`` entries when generating the
  21. intermediary ``cmake_install.cmake`` script.
  22. This policy was introduced in CMake version 3.16. CMake version |release| warns
  23. when the policy is not set and detected usage of CMake-like syntax and uses
  24. ``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD``
  25. or ``NEW`` explicitly.
  26. .. include:: DEPRECATED.txt