简体   繁体   English

如何使用CMake生成针对Windows XP的Visual Studio 2012项目?

[英]How can I generate a Visual Studio 2012 project targeting Windows XP with CMake?

With Visual Studio 2012 Update 1 released, I am hoping to build a C++ project to support Windows XP. 随着Visual Studio 2012 Update 1的发布,我希望构建一个支持Windows XP的C ++项目。 Is there a way to use CMake to generate a project that targets Windows XP? 有没有办法使用CMake生成一个针对Windows XP的项目? Basically CMake would need to generate a project file that uses Platform Toolset = Visual Studio 2012 - Windows XP (v110_xp). 基本上,CMake需要生成一个使用Platform Toolset = Visual Studio 2012 - Windows XP(v110_xp)的项目文件。

According to http://www.cmake.org/Bug/view.php?id=10722 the answer is now (soon) yes. 根据http://www.cmake.org/Bug/view.php?id=10722 ,答案现在(很快)是。

Fixed in Version CMake 2.8.11 在版本CMake 2.8.11中修复

A new "generator toolset" feature has been added here: 这里添加了一个新的“生成器工具集”功能:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dab9977 [^] http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dab9977 [^]

One may now run CMake from the command line with 现在可以从命令行运行CMake

-G "Visual Studio 10" -T "v90" -G“Visual Studio 10”-T“v90”

in order to build with a specific toolset. 为了使用特定的工具集构建。 We've not yet added a first-class interface to cmake-gui for this, but one may add the cache entry "CMAKE_GENERATOR_TOOLSET" to contain the "-T" value before configuring. 我们还没有为cmake-gui添加一个第一类接口,但可以在配置之前添加缓存条目“CMAKE_GENERATOR_TOOLSET”以包含“-T”值。

According to http://www.cmake.org/Bug/view.php?id=10722 the answer is no yes. http://www.cmake.org/Bug/view.php?id=10722答案是否定的肯定。

Update: The bug mentioned above has been resolved with the following comment: 更新:上面提到的错误已通过以下注释解决:

Fixed in Version CMake 2.8.11 在版本CMake 2.8.11中修复

A new "generator toolset" feature has been added here: 这里添加了一个新的“生成器工具集”功能:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dab9977 [^] http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dab9977 [^]

One may now run CMake from the command line with 现在可以从命令行运行CMake

-G "Visual Studio 10" -T "v90" -G“Visual Studio 10”-T“v90”

in order to build with a specific toolset. 为了使用特定的工具集构建。 We've not yet added a first-class interface to cmake-gui for this, but one may add the cache entry "CMAKE_GENERATOR_TOOLSET" to contain the "-T" value before configuring. 我们还没有为cmake-gui添加一个第一类接口,但可以在配置之前添加缓存条目“CMAKE_GENERATOR_TOOLSET”以包含“-T”值。

You might also look at the comments made to the other answers. 您还可以查看对其他答案的评论。

I think you can just generate a Solution for Visual Studio 2010/2012. 我认为您可以为Visual Studio 2010/2012生成解决方案。 Open this solution, open the solution/project in visual Studio, open the properties and reconfigure the Platform toolset to v110_xp. 打开此解决方案,在Visual Studio中打开解决方案/项目,打开属性并将Platform工具集重新配置为v110_xp。

Then you should be fine. 那你应该没问题。 But I'm still searching for the solution how to setupo the command line to build v110_xp programs... 但我仍在寻找解决方案如何设置命令行来构建v110_xp程序......

我认为解决此问题的最佳方法是使用CMake为Visual Studio 2010构建项目,然后使用Visual Studio 2012打开项目。执行此操作时,使用的工具集将是vs2010,适用于WinXP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2012项目使用MFC定位Windows XP - Visual Studio 2012 Project targeting Windows XP using MFC 用于Windows桌面的MS Visual Studio 2012 Express - 针对Windows XP - MS Visual Studio 2012 Express for Windows Desktop - Targeting Windows XP 如何使用 Visual Studio 2012 为 Windows XP 进行编译? - How do I compile for Windows XP with Visual Studio 2012? 针对Windows 2000的Visual Studio 2012 Win32项目 - visual studio 2012 win32 project targeting windows 2000 如何在Mac上获取“ Visual Studio 2012” cmake生成器? - How can I get the “Visual Studio 2012” cmake generator on mac? 如何使用Visual Studio 2012和Intel Compiler XE 2013构建可在Windows XP中运行的可执行文件? - How can I build executables which can be run in Windows XP using Visual Studio 2012 and Intel Compiler XE 2013? 我如何使用CMake生成Windows 10通用项目 - How can i use CMake to generate Windows 10 universal project 使用不带Visual Studio的构建工具2015定位Windows XP - Targeting Windows XP using Build Tools 2015 without Visual Studio 如何使用Visual Studio 2017构建针对Windows XP的Winsock2(WS2_32.lib)应用程序 - How to build a Winsock2 (WS2_32.lib) application targeting Windows XP with Visual Studio 2017 在Visual Studio 2015中使用XP Targeting进行编译时,Windows XP上出现致命错误 - Fatal error on Windows XP when compiled with XP Targeting in Visual Studio 2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM