如何使用CMake的非交互构建在Windows? [英] How to Use CMake for Non-Interactive Build on Windows?

查看:151
本文介绍了如何使用CMake的非交互构建在Windows?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建立在Windows上使用CMake的自动生成。我使用Visual Studio 2005。

I want to set up automated build using CMake on Windows. I am using Visual Studio 2005.

更新:这里是我使用的是什么:

Update: Here is what I am using:

我设置的devenv.exe我路上。然后建立我运行下面的命令。我使用哈德森建设。

I set devenv.exe to my PATH. Then to build I run the command below. I am using Hudson to build.

devenv的Crackpot.sln /建造调试/项目ALL_BUILD

devenv Crackpot.sln /build Debug /project ALL_BUILD

作为每个<一href=\"http://blogs.msdn.com/aaronhallberg/archive/2007/06/29/building-from-the-command-line-with-devenv.aspx\">http://blogs.msdn.com/aaronhallberg/archive/2007/06/29/building-from-the-command-line-with-devenv.aspx preFER使用devenv的,而不是denenv.exe,因为后者可能产生因而GUI挂构建。

As per http://blogs.msdn.com/aaronhallberg/archive/2007/06/29/building-from-the-command-line-with-devenv.aspx prefer to use "devenv" and not "denenv.exe" as the latter may spawn a GUI thus hanging the build.

推荐答案

我不知道如果我理解这个问题。您可以使用它完全像任何其他构建系统。只要指定的Visual Studio 2005年8(有点怪异,但你可以通过调用不带参数的CMake得到所有支持系统的列表),你会得到可以在命令行上构建无论是与<$ C $的解决方案C> devenv.exe的/编译或MSBuild的。

I'm not sure if I understand the question. You use it exactly like for any other build system. Just specify "Visual Studio 8 2005" (little bit weird, but you can get a list of all supported systems by calling cmake without parameters) and you'll get a solution that can be built on the command line either with devenv.exe /build or with MSBuild.

这是有点复杂的唯一的事情是,如果你想生成的解决方案时的Visual Studio安装不上,像一个构建服务器上。你可以,当然,只是安装它,但我preFER不安装的东西你不需要。在这种情况下,你必须伪造它接受的MSBuild作为构建命令行(通过指定一个批处理文件在命令行构建工具,只是重新排序参数,以便接受的MSBuild它们),所以它不会启动婊子它是如何错过的Visual Studio(这是如此疯​​狂,因为CMake的人都是在命令行天下...)

The only thing that is a little bit complicated is if you want to generate the solution when Visual Studio is not installed, like on a build server. You can, of course, just install it, but I prefer not to install things you don't need. In that case, you have to fake it to accept MSBuild as the build command line (by specifying a batch file as build tool at the command line, that just reorders the arguments so MSBuild accepts them), so that it won't start bitching about how it misses Visual Studio (which is so crazy, since the CMake people are from the command-line world...)

哦,如果你真正想要的仅仅是建立在命令行上现有的Visual Studio解决方案,你并不需要的CMake。只需致电的MSBuild或 devenv的/编译

Oh, and if what you really want is just to build an existing Visual Studio solution on the command line, you don't need CMake. Just call MSBuild or devenv /build.

这篇关于如何使用CMake的非交互构建在Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆