Installing projects on the system
In Chapter 1, First Steps with CMake, we indicated that CMake offers a command-line mode that installs built projects on the system:
cmake --install <dir> [<options>]
<dir>
is the path to the generated build tree (required). Our <options>
are as follows:
--config <cfg>
: This picks the build configuration for a multi-configuration generator.--component <comp>
: This limits the installation to the given component.--default-directory-permissions <permissions>
: This sets the default permissions for the installed directories (in<u=rwx,g=rx,o=rx>
format).--prefix <prefix>
: This specifies the non-default installation path (stored in theCMAKE_INSTALL_PREFIX
variable). It defaults to/usr/local
for Unix-like systems andc:/Program Files/${PROJECT_NAME}
for Windows.-v, --verbose
: This makes the output verbose (this can also be achieved by setting theVERBOSE
environment...