本文介绍了是否可以在cmake中不生成ALL_BUILD项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不需要ALL_BUILD子项目,可以避免生成它吗?谢谢。

解决方案

所以您无法避免-就像@arrowed答案-一样,CMake中有些东西会影响使用/的外观(在类似Visual Studio的IDE生成器上):


  1. 激活全局属性可用于将默认启动项目名称更改为 ALL_BUILD 或 first以外的名称。项目不在子文件夹中目标。



参考







I don't need ALL_BUILD subproject, can I avoid generating it? Thanx.

解决方案

CMake Issue #16979: "ALL_BUILD target being generated":

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:

  1. When you activate global USE_FOLDERS property

     set_property(GLOBAL PROPERTY USE_FOLDERS ON)
    

    the generic targets ALL_BUILD, ZERO_CHECK, INSTALL, PACKAGE and RUN_TESTS will be grouped into the CMakePredefinedTargets folder (or whichever name is given in global PREDEFINED_TARGETS_FOLDER property).

  2. The global variables CMAKE_SKIP_INSTALL_ALL_DEPENDENCY and CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY do suppress otherwise automatically generated dependencies for INSTALL or PACKAGE to the ALL_BUILD target.

  3. The global VS_STARTUP_PROJECT property can be used to change the default startup project name to something other than the ALL_BUILD or "first project not in sub-folder" targets.

References

这篇关于是否可以在cmake中不生成ALL_BUILD项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 18:44