CMAKE_INSTALL_PREFIX
Install directory used by install.
If “make install” is invoked or INSTALL is built, this directory is prepended onto all install directories. This variable defaults to /usr/local on UNIX and c:/Program Files on Windows.
On UNIX one can use the DESTDIR mechanism in order to relocate the whole installation. DESTDIR means DESTination DIRectory. It is commonly used by makefile users in order to install software at non-default location. It is usually invoked like this:
make DESTDIR=/home/john install
which will install the concerned software using the installation prefix, e.g. “/usr/local” prepended with the DESTDIR value which finally gives “/home/john/usr/local”.
WARNING: DESTDIR may not be used on Windows because installation prefix usually contains a drive letter like in “C:/Program Files” which cannot be prepended with some other prefix.
The installation prefix is also added to CMAKE_SYSTEM_PREFIX_PATH so that find_package, find_program, find_library, find_path, and find_file will search the prefix for other software.

本文详细介绍了CMake中CMAKE_INSTALL_PREFIX变量的作用及其默认值,并解释了如何使用DESTDIR机制来改变安装位置,特别是在不同操作系统上的应用。此外,还提到了安装前缀如何被加入到CMAKE_SYSTEM_PREFIX_PATH中以辅助查找其他软件。
3万+

被折叠的 条评论
为什么被折叠?



