How to use CMake to install - Stack Overflow
stackoverflow.com › questions › 48428647You can use the command cmake --build . --target install --config Debug for installation. CMake's build tool mode supports further arguments that are of interest in this case. You can select the target to build by --target option, the configuration to build by --config option, and pass arguments to the underlying build tool by means of the -- option.
CMAKE_BUILD_WITH_INSTALL_RPATH — CMake 3.23.0-rc3 Documentation
cmake.org › CMAKE_BUILD_WITH_INSTALL_RPATHCMAKE_BUILD_WITH_INSTALL_RPATH ¶. CMAKE_BUILD_WITH_INSTALL_RPATH. ¶. Use the install path for the RPATH. Normally CMake uses the build tree for the RPATH when building executables etc on systems that use RPATH. When the software is installed the executables etc are relinked by CMake to have the install RPATH. If this variable is set to true then the software is always built with the install path for the RPATH and does not need to be relinked when installed.
Installing Files — Mastering CMake
cmake.org › mastering-cmake › chapterSoftware is typically installed into a directory separate from the source and build trees. This allows it to be distributed in a clean form and isolates users from the details of the build process. CMake provides the install command to specify how a project is to be installed. This command is invoked by a project in the CMakeLists file and tells CMake how to generate installation scripts.
Installing | CMake
cmake.org › installcmake . make make install. (Note: the make install step is optional, cmake will run from the build directory.) If you are not using the GNU C++ compiler, you need to tell the bootstrap script (or cmake) which compiler you want to use. This is done by setting the environment variables CC and CXX before running it.