问题描述
我正在使用 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 解决方案的启动项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!