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

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

问题描述

我想在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到我的PATH。然后建立我运行下面的命令。我使用Hudson构建。

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

devenv Crackpot.sln / build调试/项目ALL_BUILD

devenv Crackpot.sln /build Debug /project ALL_BUILD

a href =http://blogs.msdn.com/aaronhallberg/archive/2007/06/29/building-from-the-command-line-with-devenv.aspx =nofollow noreferrer> http:/ /blogs.msdn.com/aaronhallberg/archive/2007/06/29/building-from-the-command-line-with-devenv.aspx 更喜欢使用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 8 2005(有点奇怪,但你可以通过调用cmake没有参数获得所有支持的系统的列表),你会得到一个解决方案,可以在命令行上建立 devenv.exe / build 或使用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没有安装,就像在一个构建服务器。你可以,当然,只是安装它,但我不喜欢安装你不需要的东西。在这种情况下,您必须伪造它接受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 / build

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.

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

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