可以不在cmake中生成ALL_BUILD项目吗?
Is it possible not to generate ALL_BUILD project in cmake?
我不需要ALL_BUILD子项目,我可以避免生成它吗?谢谢
它对应于all
make 目标,所以,不,你无法避免生成它。不过,您可以手动将其从解决方案中删除。
CMake Issue #16979: "ALL_BUILD target being generated":
The ALL_BUILD
target corresponds to CMake's notion of the "all" target, equivalent to make all with makefile generators. This is different from "Build Solution" behavior due to idiosyncrasies in how the VS IDE deals with inter-vcxproj dependencies.
There is no way to suppress the ALL_BUILD
target. It must exist for commands like cmake --build
. to be able to build the "all" target by default.
所以你无法避免它——就像@arrowd 的回答一样——但是 CMake 中有一些东西会影响 usage/appearance(在 IDE 生成器上,比如 Visual Studio)其中:
当你激活全局USE_FOLDERS
属性
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
通用目标 ALL_BUILD
、ZERO_CHECK
、INSTALL
、PACKAGE
和 RUN_TESTS
将分组到 CMakePredefinedTargets
文件夹(或以全局 PREDEFINED_TARGETS_FOLDER
属性).
中给出的名称为准
全局变量 CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
和 CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY
会抑制 INSTALL
或 PACKAGE
对 ALL_BUILD
目标自动生成的依赖关系.
全局 VS_STARTUP_PROJECT
属性 可用于将默认启动项目名称更改为 ALL_BUILD
或“第一个项目不在 sub-folder" 目标。
参考资料
- What are ALL_BUILD and ZERO_CHECK and do I need them?
- How to skip dependency on all for package target?
我不需要ALL_BUILD子项目,我可以避免生成它吗?谢谢
它对应于all
make 目标,所以,不,你无法避免生成它。不过,您可以手动将其从解决方案中删除。
CMake Issue #16979: "ALL_BUILD target being generated":
The
ALL_BUILD
target corresponds to CMake's notion of the "all" target, equivalent to make all with makefile generators. This is different from "Build Solution" behavior due to idiosyncrasies in how the VS IDE deals with inter-vcxproj dependencies.There is no way to suppress the
ALL_BUILD
target. It must exist for commands likecmake --build
. to be able to build the "all" target by default.
所以你无法避免它——就像@arrowd 的回答一样——但是 CMake 中有一些东西会影响 usage/appearance(在 IDE 生成器上,比如 Visual Studio)其中:
当你激活全局
USE_FOLDERS
属性set_property(GLOBAL PROPERTY USE_FOLDERS ON)
通用目标
中给出的名称为准ALL_BUILD
、ZERO_CHECK
、INSTALL
、PACKAGE
和RUN_TESTS
将分组到CMakePredefinedTargets
文件夹(或以全局PREDEFINED_TARGETS_FOLDER
属性).全局变量
CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
和CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY
会抑制INSTALL
或PACKAGE
对ALL_BUILD
目标自动生成的依赖关系.全局
VS_STARTUP_PROJECT
属性 可用于将默认启动项目名称更改为ALL_BUILD
或“第一个项目不在 sub-folder" 目标。
参考资料
- What are ALL_BUILD and ZERO_CHECK and do I need them?
- How to skip dependency on all for package target?