CMP0095.rst 1.5 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. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
  23. .. |WARNS_OR_DOES_NOT_WARN| replace::
  24. warns when it detects use of CMake-like syntax
  25. .. include:: STANDARD_ADVICE.txt
  26. .. include:: DEPRECATED.txt