CPACK_SET_DESTDIR.rst 1.3 KB

123456789101112131415161718192021222324252627282930
  1. CPACK_SET_DESTDIR
  2. -----------------
  3. Boolean toggle to make CPack use DESTDIR mechanism when packaging.
  4. DESTDIR means DESTination DIRectory. It is commonly used by makefile
  5. users in order to install software at non-default location. It is a
  6. basic relocation mechanism that should not be used on Windows (see
  7. CMAKE_INSTALL_PREFIX documentation). It is usually invoked like this:
  8. ::
  9. make DESTDIR=/home/john install
  10. which will install the concerned software using the installation
  11. prefix, e.g. "/usr/local" prepended with the DESTDIR value which
  12. finally gives "/home/john/usr/local". When preparing a package, CPack
  13. first installs the items to be packaged in a local (to the build tree)
  14. directory by using the same DESTDIR mechanism. Nevertheless, if
  15. CPACK_SET_DESTDIR is set then CPack will set DESTDIR before doing the
  16. local install. The most noticeable difference is that without
  17. CPACK_SET_DESTDIR, CPack uses CPACK_PACKAGING_INSTALL_PREFIX as a
  18. prefix whereas with CPACK_SET_DESTDIR set, CPack will use
  19. CMAKE_INSTALL_PREFIX as a prefix.
  20. Manually setting CPACK_SET_DESTDIR may help (or simply be necessary)
  21. if some install rules uses absolute DESTINATION (see CMake INSTALL
  22. command). However, starting with CPack/CMake 2.8.3 RPM and DEB
  23. installers tries to handle DESTDIR automatically so that it is seldom
  24. necessary for the user to set it.