How to Use CMake for Non-Interactive Build on Windows?

前端 未结 4 1128
离开以前
离开以前 2021-02-06 02:03

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

Update: Here is what I am using:

I set devenv.exe to my

4条回答
  •  北海茫月
    2021-02-06 02:24

    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.

    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...)

    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.

提交回复
热议问题