什么是 ALL_BUILD 和 ZERO_CHECK,我需要它们吗?

我创建了一个简单的 CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
project (HelloWorld)
add_executable (HelloWorld main.cpp)

然而,当我从 CMake 生成 VS2012或 VS2010项目时,我得到了这两个附加条目—— ALL _ BUILD 和 ZERO _ CHECK。 我不明白他们的目的,我需要他们吗?

enter image description here

33712 次浏览

From 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".

Add the following line to you CMakeLists.txt to suppress generation of ZERO_CHECK:

set(CMAKE_SUPPRESS_REGENERATION true)