简体   繁体   English

如何在Mac上获取“ Visual Studio 2012” cmake生成器?

[英]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.

相关问题 如何使用CMake生成针对Windows XP的Visual Studio 2012项目? - How can I generate a Visual Studio 2012 project targeting Windows XP with CMake? 带有cmake的Visual Studio 2013中的Qt-如何使它工作? - Qt in Visual Studio 2013 with cmake - how do I get this to work? 如何在 CMake 中为 Visual Studio 生成器添加预编译头文件 - How to add precompiled headers in CMake for visual studio generator 如何取消定义Visual Studio 2012的系统定义? - How can I undefine the System Definitions of Visual Studio 2012? 如何在Visual Studio 2012中引用CChannel.h? - How can I reference CChannel.h in Visual Studio 2012? 使用CMake为Visual Studio 2012编译SFML - Compiling SFML for Visual Studio 2012 using CMake 什么是 Visual Studio 2019 的 cmake 生成器 - What's the cmake generator for Visual Studio 2019 如何获得 CMake 工具以使用 C++11(或更高版本)功能在 Visual Studio Code 中编译程序? - How do I get CMake Tools to compile programs in Visual Studio Code with C++11 (or higher) features? 我无法在Visual Studio 2012中使SDL + OpenGL工作 - I can't make SDL + OpenGL work in Visual Studio 2012 我可以在Visual Studio 2012中将方法声明为朋友吗? - Can I declare a method as friend in Visual Studio 2012?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM