如何通过CMake更改Visual Studio解决方案的启动项目? [英] How do I change the startup project of a Visual Studio solution via CMake?

查看:412
本文介绍了如何通过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解决方案的启动项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆