DESTDIR.rst 1.0 KB

123456789101112131415161718192021222324252627282930
  1. DESTDIR
  2. -------
  3. .. include:: ENV_VAR.txt
  4. On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
  5. whole installation. ``DESTDIR`` means DESTination DIRectory. It is
  6. commonly used by packagers to install software in a staging directory.
  7. For example, running
  8. .. code-block:: shell
  9. make DESTDIR=/package/stage install
  10. will install the software using the installation prefix, e.g. ``/usr/local``,
  11. prepended with the ``DESTDIR`` value which gives ``/package/stage/usr/local``.
  12. The packaging tool may then construct the package from the content of the
  13. ``/package/stage`` directory.
  14. See the :variable:`CMAKE_INSTALL_PREFIX` variable to control the
  15. installation prefix when configuring a build tree. Or, when using
  16. the :manual:`cmake(1)` command-line tool's ``--install`` mode,
  17. one may specify a different prefix using the ``--prefix`` option.
  18. .. note::
  19. ``DESTDIR`` may not be used on Windows because installation
  20. prefix usually contains a drive letter like in ``C:/Program Files``
  21. which cannot be prepended with some other prefix.