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