问题描述
关于,有一个所谓的安装在CMake中。我习惯于按如下顺序运行CMake:
With reference to this question there is a so-called 'install' phase in CMake. I'm used to run CMake in a sequence that looks like this:
cmake ..
cmake --build . --config Debug
cmake --build . --config Release
是否有 cmake --install
打算在此之后调用命令行开关吗?
Is there a cmake --install
command line switch meant to be invoked after this?
尽管我认为它之间存在某种联系,但我并不是在寻找所谓的 install 命令(我认为这是函数而不是命令,但这可能是术语问题)。
Although I figure it is somehow related, I'm not looking for the so called install
command here (I perceive this to be a function rather than a command, but this is likely a terminology issue).
推荐答案
否,此开关不存在(直到CMake 3.15,请参阅我的其他答案)。
No, this switch does not exist (until CMake 3.15, see my other answer).
如果项目使用 install
命令,它将生成目标 install
。您可以使用
If a project uses the install
command, it generates the target install
. You can call it with
cmake --build . --target install
这使用CMake的,这是用于向本地用户发送几个命令的抽象界面构建工具(例如make或Ninja),还可以用于将任意参数传递给本机构建工具。
This uses CMake's Build Tool Mode, which is an abstract interface for a couple of commands to the native build tool (e.g. make or Ninja) and can also be used to pass arbitrary arguments to the native build tool.
这篇关于是否有CMake'--install'开关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!