[英]How can I get the “Visual Studio 2012” cmake generator on mac?
For a CS class I'm taking, the C++ assignments need to be submitted as Visual Studio 2012 projects. 对于我正在学习的CS类,C ++作业需要作为Visual Studio 2012项目提交。 I'd really rather not use Visual Studio, so I'm thinking about creating cmake projects instead, then generating Visual Studio project files using cmake.
我真的不希望使用Visual Studio,因此我正在考虑创建cmake项目,然后使用cmake生成Visual Studio项目文件。 I know this is possible using
cmake -G "Visual Studio 11"
, but this only seems to work on Windows. 我知道可以使用
cmake -G "Visual Studio 11"
,但这似乎只能在Windows上运行。 When I run cmake on my computer, I get a list of generators, and the Visual Studio generators aren't listed. 当我在计算机上运行cmake时,会得到一个生成器列表,而Visual Studio生成器未列出。 I know that the cmake website says that generators are platform specific, but is there some way to get these generators working on OS X?
我知道cmake网站上说生成器是特定于平台的,但是有什么方法可以使这些生成器在OS X上运行?
Edit : For anyone coming across this question later, you should look into premake instead of messing with cmake. 编辑 :对于以后遇到这个问题的任何人,您应该研究预制件,而不要弄乱cmake。 If you get premake 5, which is currently the development version, you can use it to generate Visual Studio 2012 files from Mac or Linux without needing to use Windows at all (on Windows you can generate Xcode projects without having to use OS X as well).
如果您获得的是当前开发版本的premake 5,则可以使用它从Mac或Linux生成Visual Studio 2012文件,而根本不需要使用Windows(在Windows上,您也可以生成Xcode项目,而不必使用OS X )。
CMake需要调用Visual Studio编译器来检查编译器版本,因此我无法在OS X上找到它,这就是为什么它是特定于平台的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.