CMAKE_INSTALL_PREFIX.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CMAKE_INSTALL_PREFIX
  2. --------------------
  3. Install directory used by :command:`install`.
  4. If ``make install`` is invoked or ``INSTALL`` is built, this directory is
  5. prepended onto all install directories. This variable defaults to
  6. ``/usr/local`` on UNIX and ``c:/Program Files`` on Windows.
  7. On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
  8. whole installation. ``DESTDIR`` means DESTination DIRectory. It is
  9. commonly used by makefile users in order to install software at
  10. non-default location. It is usually invoked like this:
  11. ::
  12. make DESTDIR=/home/john install
  13. which will install the concerned software using the installation
  14. prefix, e.g. ``/usr/local`` prepended with the ``DESTDIR`` value which
  15. finally gives ``/home/john/usr/local``.
  16. WARNING: ``DESTDIR`` may not be used on Windows because installation
  17. prefix usually contains a drive letter like in ``C:/Program Files``
  18. which cannot be prepended with some other prefix.
  19. The installation prefix is also added to :variable:`CMAKE_SYSTEM_PREFIX_PATH`
  20. so that :command:`find_package`, :command:`find_program`,
  21. :command:`find_library`, :command:`find_path`, and :command:`find_file`
  22. will search the prefix for other software.
  23. .. note::
  24. Use the :module:`GNUInstallDirs` module to provide GNU-style
  25. options for the layout of directories within the installation.