C++ 什么是 ALL_BUILD 和 ZERO_CHECK,我需要它们吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27175754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are ALL_BUILD and ZERO_CHECK and do I need them?
提问by sashoalm
I've created a simple CMakeLists.txt:
我创建了一个简单的 CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project (HelloWorld)
add_executable (HelloWorld main.cpp)
When I generate a VS2012 or VS2010 project from CMake, however, I get these 2 additional entries - ALL_BUILD and ZERO_CHECK. I don't understand their purpose, do I need them?
然而,当我从 CMake 生成 VS2012 或 VS2010 项目时,我得到了这两个额外的条目 - ALL_BUILD 和 ZERO_CHECK。我不明白他们的目的,我需要他们吗?
采纳答案by sashoalm
After some more searching, I found the answer at https://cmake.org/pipermail/cmake/2008-November/025448.html:
经过更多搜索,我在https://cmake.org/pipermail/cmake/2008-November/025448.html找到了答案:
Armin Berres — 11/22/2008, 3:12:41 PM
ZERO_CHECK will rerun cmake. You can/should execute this after changing something on your CMake files.
ALL_BUILD is simply a target which builds all and everything project in the active solution, I guess one can compare it to "make all".
阿明·贝雷斯 — 2008 年 11 月 22 日,下午 3:12:41
ZERO_CHECK 将重新运行 cmake。您可以/应该在更改 CMake 文件上的某些内容后执行此操作。
ALL_BUILD 只是一个在活动解决方案中构建所有项目的目标,我想可以将它与“全部制作”进行比较。
回答by user2902980
add this line to you CMakeLists.txt to supress generation of ZERO_CHECK.
将此行添加到 CMakeLists.txt 以抑制 ZERO_CHECK 的生成。
set(CMAKE_SUPPRESS_REGENERATION true)