I don't need ALL_BUILD subproject, can I avoid generating it? Thanx.
2 Answers
CMake Issue #16979: "ALL_BUILD target being generated":
The
ALL_BUILDtarget 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_BUILDtarget. It must exist for commands likecmake --build. to be able to build the "all" target by default.
So you can't avoid it - as with @arrowd answer - but there are some things in CMake that can influence the usage/appearance (on IDE generators like Visual Studio) of it:
When you activate global
USE_FOLDERSpropertyset_property(GLOBAL PROPERTY USE_FOLDERS ON)the generic targets
ALL_BUILD,ZERO_CHECK,INSTALL,PACKAGEandRUN_TESTSwill be grouped into theCMakePredefinedTargetsfolder (or whichever name is given in globalPREDEFINED_TARGETS_FOLDERproperty).The global variables
CMAKE_SKIP_INSTALL_ALL_DEPENDENCYandCMAKE_SKIP_PACKAGE_ALL_DEPENDENCYdo suppress otherwise automatically generated dependencies forINSTALLorPACKAGEto theALL_BUILDtarget.The global
VS_STARTUP_PROJECTproperty can be used to change the default startup project name to something other than theALL_BUILDor "first project not in sub-folder" targets.
References
-
is there a way to make "current selection" the default start project? – user1050755 Mar 11 '22 at 20:58
It corresponds to the all make target, so, no, you can't avoid generating it. You can delete it from the solution manually, though.
- 33,231
- 8
- 79
- 110
