Is there a CMake '--install' switch?

Regarding this issue, CMake has a so-called installation phase. I'm used to running CMake in this sequence:

cmake .. cmake --build . --config Debug cmake --build . --config Release 

Is there a cmake --install command line cmake --install that should be called after that?

Although I believe this is somehow connected, I am not looking for the so-called install command here (I perceive this as a function, not as a command, but this is most likely a terminology problem).

+28
source share
2 answers

No, this switch does not exist (prior to CMake 3.15, see my other answer).

If the project uses the install command, it generates the target install . You can call with

 cmake --build . --target install 

It uses the CMake Build Tool Mode , which is an abstract interface for a pair of commands of the built-in build tool (for example, make or Ninja) and can also be used to pass arbitrary arguments to the built-in build tool.

+47
source

Starting with version 3.15, CMake offers to install a switch. From the release notes:

The cmake (1) command received a new option --install. This can be used after building the project to start the installation without using the generated build system or the built-in build tool.

Source: https://cmake.org/cmake/help/v3.15/release/3.15.html#id6

0
source

Source: https://habr.com/ru/post/1237239/


All Articles