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