什么是CMake的默认创建目标的名字吗? [英] What is the name of CMake's default build target?
问题描述
我有一个自定义的目标,我希望它依赖于默认的目标(即是建立与一让
)。
I have a custom target, and I want it to depend on the default target (the one that is built with make
).
add_custom_target(foo ....)
add_dependency(foo default_target_name_goes_here)
什么是默认目标的名称?
What is the name of the default target?
我试过所有
, ALL_BUILD
, MyProjectsName
,默认
...
I've tried ALL
, ALL_BUILD
, MyProjectsName
, DEFAULT
,...
在CMake的文档中找到任何东西始终是一个不成功的冒险...
Finding anything in the CMake documentation is always an unsuccessful adventure...
更新:它似乎CMake的以这样的方式设计,这是非常难以修复/实现:错误报告得到+ 1的自2009年以来。谁确实想有依赖,例如自定义的目标,在所有
目标?或者换句话说:谁不曾经写使&放大器;&安培;使测试
?...
UPDATE: it seems CMake was designed in such a way that this is extremely hard to fix/implement: bugreport getting +1's since 2009. Who indeed would like to have a custom target that depends on, for example, the all
target? Or in other words: who does ever write make && make test
?...
推荐答案
默认的构建目标为目标的CMake CMake的在不存在配置时间。它只存在于产生的构建系统。因此,不可能有默认的目标取决于定制目标
The default build target does not exist as a CMake target at CMake configure time. It is only exists in the generated build system. Therefore it is not possible to have the default target depend on a custom target.
这篇关于什么是CMake的默认创建目标的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!