如何通过CMake更改Visual Studio解决方案的启动项目?

编程入门 行业动态 更新时间:2024-10-10 04:26:04
本文介绍了如何通过CMake更改Visual Studio解决方案的启动项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用CMake生成Visual Studio项目.除了一件事,一切都正常.

I am using CMake to generate Visual Studio projects. Everything works fine except one thing.

解决方案中的启动项目始终为ALL_BUILD.如何通过CMake将启动项目更改为我想要的真实项目?

The startup project in the solution is always ALL_BUILD. How do I change the startup project to the real project I want via CMake?

推荐答案

您不能.启动项目存储在一个二进制文件中,该文件不是CMake生成的.如果没有该二进制文件,Visual Studio将默认为解决方案文件中的第一个项目,而ALL_BUILD项目始终是第一个项目.

You can't. The startup-project is stored in a binary file, which is NOT generated by CMake. Without that binary file, visual studio will default to the first project in the solution file and the ALL_BUILD project is always first...

更新:此答案是过时的",因为现在可以在CMake 3.6中使用.参见 ComicSansMS的答案.

Update: this answer is "out-of-date" since it is now feasible with CMake 3.6. See the answer by ComicSansMS.

更多推荐

如何通过CMake更改Visual Studio解决方案的启动项目?

本文发布于:2023-11-09 23:19:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573716.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:解决方案   项目   CMake   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!