您可以从命令行运行 CMake。你可以跑。
cmake.exe -G"Visual Studio 8 2005" -H<source_dir> -B<build_dir>
下面是原始命令行使用输出的片段。请注意,那里没有记录 -H 和 -B 选项。但它们可用于在命令行上显式定义源目录和构建目录。
C:\Program Files (x86)\CMake 2.6\bin>cmake
cmake version 2.6-patch 4
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
Options
-C <initial-cache> = Pre-load a script to populate the cache.
-D <var>:<type>=<value> = Create a cmake cache entry.
-U <globbing_expr> = Remove matching entries from CMake cache.
-G <generator-name> = 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 <file> = Process script mode.
这是可用的生成器。
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.