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

前端 未结 4 1143
离开以前
离开以前 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:35

    You can run CMake from the command line. You could run.

    cmake.exe -G"Visual Studio 8 2005" -H -B
    

    Below is a snippet from the original command line usage output. Notice that the -H and -B option are not documented there. But they can be used to explicitly define the source and build directories on the command line.

    C:\Program Files (x86)\CMake 2.6\bin>cmake
      cmake version 2.6-patch 4
      Usage
    
      cmake [options] 
      cmake [options] 
    
      Options
      -C           = Pre-load a script to populate the cache.
      -D :=     = Create a cmake cache entry.
      -U           = Remove matching entries from CMake cache.
      -G          = Specify a makefile generator.
      -Wno-dev                    = Suppress developer warnings.
      -Wdev                       = Enable developer warnings.
      -E                          = CMake command mode.
      -i                          = Run in wizard mode.
      -L[A][H]                    = List non-advanced cached variables.
      -N                          = View mode only.
      -P                    = Process script mode.
    

    Here are the available generators.

    Generators
    
    The following generators are available on this platform:
      Borland Makefiles           = Generates Borland makefiles.
      MSYS Makefiles              = Generates MSYS makefiles.
      MinGW Makefiles             = Generates a make file for use with
                                    mingw32-make.
      NMake Makefiles             = Generates NMake makefiles.
      Unix Makefiles              = Generates standard UNIX makefiles.
      Visual Studio 6             = Generates Visual Studio 6 project files.
      Visual Studio 7             = Generates Visual Studio .NET 2002 project
                                    files.
      Visual Studio 7 .NET 2003   = Generates Visual Studio .NET 2003 project
                                    files.
      Visual Studio 8 2005        = Generates Visual Studio .NET 2005 project
                                    files.
      Visual Studio 8 2005 Win64  = Generates Visual Studio .NET 2005 Win64
                                    project files.
      Visual Studio 9 2008        = Generates Visual Studio 9 2008 project files.
      Visual Studio 9 2008 Win64  = Generates Visual Studio 9 2008 Win64 project
                                    files.
      Watcom WMake                = Generates Watcom WMake makefiles.
      CodeBlocks - MinGW Makefiles= Generates CodeBlocks project files.
      CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
      Eclipse CDT4 - MinGW Makefiles
                                  = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - NMake Makefiles
                                  = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - Unix Makefiles
                                  = Generates Eclipse CDT 4.0 project files.  
    

提交回复
热议问题