CMAKE-GENERATORS(7) CMake CMAKE-GENERATORS(7)
NAME
cmake-generators - CMake Generators Reference
INTRODUCTION
A CMake Generator is responsible for writing the input files for a na-
tive build system. Exactly one of the CMake Generators must be se-
lected for a build tree to determine what native build system is to be
used. Optionally one of the Extra Generators may be selected as a
variant of some of the Command-Line Build Tool Generators to produce
project files for an auxiliary IDE.
CMake Generators are platform-specific so each may be available only on
certain platforms. The cmake(1) command-line tool --help output lists
available generators on the current platform. Use its -G option to
specify the generator for a new build tree. The cmake-gui(1) offers
interactive selection of a generator when creating a new build tree.
CMAKE GENERATORS
Command-Line Build Tool Generators
These generators support command-line build tools. In order to use
them, one must launch CMake from a command-line prompt whose environ-
ment is already configured for the chosen compiler and build tool.
Makefile Generators
Borland Makefiles
Generates Borland makefiles.
MSYS Makefiles
Generates makefiles for use with MSYS (Minimal SYStem) make under the
MSYS shell.
Use this generator in a MSYS shell prompt and using make as the build
tool. The generated makefiles use /bin/sh as the shell to launch build
rules. They are not compatible with a Windows command prompt.
To build under a Windows command prompt, use the MinGW Makefiles gener-
ator.
MinGW Makefiles
Generates makefiles for use with mingw32-make under a Windows command
prompt.
Use this generator under a Windows command prompt with MinGW (Minimal-
ist GNU for Windows) in the PATH and using mingw32-make as the build
tool. The generated makefiles use cmd.exe as the shell to launch build
rules. They are not compatible with MSYS or a unix shell.
To build under the MSYS shell, use the MSYS Makefiles generator.
NMake Makefiles
Generates NMake makefiles.
NMake Makefiles JOM
Generates JOM makefiles.
Unix Makefiles
Generates standard UNIX makefiles.
A hierarchy of UNIX makefiles is generated into the build tree. Use
any standard UNIX-style make program to build the project through the
all target and install the project through the install (or in-
stall/strip) target.
For each subdirectory sub/dir of the project a UNIX makefile will be
created, containing the following targets:
all Depends on all targets required by the subdirectory.
install
Runs the install step in the subdirectory, if any.
install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
test Runs the test step in the subdirectory, if any.
package
Runs the package step in the subdirectory, if any.
Watcom WMake
Generates Watcom WMake makefiles.
Ninja Generators
Ninja
Generates build.ninja files.
A build.ninja file is generated into the build tree. Use the ninja
program to build the project through the all target and install the
project through the install (or install/strip) target.
For each subdirectory sub/dir of the project, additional targets are
generated:
sub/dir/all
Depends on all targets required by the subdirectory.
sub/dir/install
Runs the install step in the subdirectory, if any.
sub/dir/install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
sub/dir/test
Runs the test step in the subdirectory, if any.
sub/dir/package
Runs the package step in the subdirectory, if any.
Fortran Support
The Ninja generator conditionally supports Fortran when the ninja tool
is at least version 1.10 (which has the required features).
See Also
The Ninja Multi-Config generator is similar to the Ninja generator, but
generates multiple configurations at once.
Ninja Multi-Config
Generates multiple build-<Config>.ninja files.
This generator is very much like the Ninja generator, but with some key
differences. Only these differences will be discussed in this document.
Unlike the Ninja generator, Ninja Multi-Config generates multiple con-
figurations at once with CMAKE_CONFIGURATION_TYPES instead of only one
configuration with CMAKE_BUILD_TYPE. One build-<Config>.ninja file will
be generated for each of these configurations (with <Config> being the
configuration name.) These files are intended to be run with ninja -f
build-<Config>.ninja. A build.ninja file is also generated, using the
configuration from either CMAKE_DEFAULT_BUILD_TYPE or the first item
from CMAKE_CONFIGURATION_TYPES.
cmake --build . --config <Config> will always use build-<Config>.ninja
to build. If no --config argument is specified, cmake --build . will
default to build-Debug.ninja, unless a build.ninja is generated (see
below), in which case that will be used instead.
Each build-<Config>.ninja file contains <target> targets as well as
<target>:<Config> targets, where <Config> is the same as the configura-
tion specified in build-<Config>.ninja Additionally, if cross-config
mode is enabled, build-<Config>.ninja may contain <target>:<OtherCon-
fig> targets, where <OtherConfig> is a cross-config, as well as <tar-
get>:all, which builds the target in all cross-configs. See below for
how to enable cross-config mode.
The Ninja Multi-Config generator recognizes the following variables:
CMAKE_CONFIGURATION_TYPES
Specifies the total set of configurations to build.
CMAKE_CROSS_CONFIGS
Specifies a semicolon-separated list of configurations available
from all build-<Config>.ninja files.
CMAKE_DEFAULT_BUILD_TYPE
Specifies the configuration to use by default in a build.ninja
file.
CMAKE_DEFAULT_CONFIGS
Specifies a semicolon-separated list of configurations to build
for a target in build.ninja if no :<Config> suffix is specified.
Consider the following example:
cmake_minimum_required(VERSION 3.16)
project(MultiConfigNinja C)
add_executable(generator generator.c)
add_custom_command(OUTPUT generated.c COMMAND generator generated.c)
add_library(generated ${CMAKE_BINARY_DIR}/generated.c)
Now assume you configure the project with Ninja Multi-Config and run
one of the following commands:
ninja -f build-Debug.ninja generated
# OR
cmake --build . --config Debug --target generat.
CMAKE-GENERATORS(7) CMake CMAKE-GENERATORS(7)
NAME
cmake-generators - CMake Generators Reference
INTRODUCTION
A CMake Generator is responsible for writing the input files for a na-
tive build system. Exactly one of the CMake Generators must be se-
lected for a build tree to determine what native build system is to be
used. Optionally one of the Extra Generators may be selected as a
variant of some of the Command-Line Build Tool Generators to produce
project files for an auxiliary IDE.
CMake Generators are platform-specific so each may be available only on
certain platforms. The cmake(1) command-line tool --help output lists
available generators on the current platform. Use its -G option to
specify the generator for a new build tree. The cmake-gui(1) offers
interactive selection of a generator when creating a new build tree.
CMAKE GENERATORS
Command-Line Build Tool Generators
These generators support command-line build tools. In order to use
them, one must launch CMake from a command-line prompt whose environ-
ment is already configured for the chosen compiler and build tool.
Makefile Generators
Borland Makefiles
Generates Borland makefiles.
MSYS Makefiles
Generates makefiles for use with MSYS (Minimal SYStem) make under the
MSYS shell.
Use this generator in a MSYS shell prompt and using make as the build
tool. The generated makefiles use /bin/sh as the shell to launch build
rules. They are not compatible with a Windows command prompt.
To build under a Windows command prompt, use the MinGW Makefiles gener-
ator.
MinGW Makefiles
Generates makefiles for use with mingw32-make under a Windows command
prompt.
Use this generator under a Windows command prompt with MinGW (Minimal-
ist GNU for Windows) in the PATH and using mingw32-make as the build
tool. The generated makefiles use cmd.exe as the shell to launch build
rules. They are not compatible with MSYS or a unix shell.
To build under the MSYS shell, use the MSYS Makefiles generator.
NMake Makefiles
Generates NMake makefiles.
NMake Makefiles JOM
Generates JOM makefiles.
Unix Makefiles
Generates standard UNIX makefiles.
A hierarchy of UNIX makefiles is generated into the build tree. Use
any standard UNIX-style make program to build the project through the
all target and install the project through the install (or in-
stall/strip) target.
For each subdirectory sub/dir of the project a UNIX makefile will be
created, containing the following targets:
all Depends on all targets required by the subdirectory.
install
Runs the install step in the subdirectory, if any.
install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
test Runs the test step in the subdirectory, if any.
package
Runs the package step in the subdirectory, if any.
Watcom WMake
Generates Watcom WMake makefiles.
Ninja Generators
Ninja
Generates build.ninja files.
A build.ninja file is generated into the build tree. Use the ninja
program to build the project through the all target and install the
project through the install (or install/strip) target.
For each subdirectory sub/dir of the project, additional targets are
generated:
sub/dir/all
Depends on all targets required by the subdirectory.
sub/dir/install
Runs the install step in the subdirectory, if any.
sub/dir/install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
sub/dir/test
Runs the test step in the subdirectory, if any.
sub/dir/package
Runs the package step in the subdirectory, if any.
Fortran Support
The Ninja generator conditionally supports Fortran when the ninja tool
is at least version 1.10 (which has the required features).
See Also
The Ninja Multi-Config generator is similar to the Ninja generator, but
generates multiple configurations at once.
Ninja Multi-Config
Generates multiple build-<Config>.ninja files.
This generator is very much like the Ninja generator, but with some key
differences. Only these differences will be discussed in this document.
Unlike the Ninja generator, Ninja Multi-Config generates multiple con-
figurations at once with CMAKE_CONFIGURATION_TYPES instead of only one
configuration with CMAKE_BUILD_TYPE. One build-<Config>.ninja file will
be generated for each of these configurations (with <Config> being the
configuration name.) These files are intended to be run with ninja -f
build-<Config>.ninja. A build.ninja file is also generated, using the
configuration from either CMAKE_DEFAULT_BUILD_TYPE or the first item
from CMAKE_CONFIGURATION_TYPES.
cmake --build . --config <Config> will always use build-<Config>.ninja
to build. If no --config argument is specified, cmake --build . will
default to build-Debug.ninja, unless a build.ninja is generated (see
below), in which case that will be used instead.
Each build-<Config>.ninja file contains <target> targets as well as
<target>:<Config> targets, where <Config> is the same as the configura-
tion specified in build-<Config>.ninja Additionally, if cross-config
mode is enabled, build-<Config>.ninja may contain <target>:<OtherCon-
fig> targets, where <OtherConfig> is a cross-config, as well as <tar-
get>:all, which builds the target in all cross-configs. See below for
how to enable cross-config mode.
The Ninja Multi-Config generator recognizes the following variables:
CMAKE_CONFIGURATION_TYPES
Specifies the total set of configurations to build.
CMAKE_CROSS_CONFIGS
Specifies a semicolon-separated list of configurations available
from all build-<Config>.ninja files.
CMAKE_DEFAULT_BUILD_TYPE
Specifies the configuration to use by default in a build.ninja
file.
CMAKE_DEFAULT_CONFIGS
Specifies a semicolon-separated list of configurations to build
for a target in build.ninja if no :<Config> suffix is specified.
Consider the following example:
cmake_minimum_required(VERSION 3.16)
project(MultiConfigNinja C)
add_executable(generator generator.c)
add_custom_command(OUTPUT generated.c COMMAND generator generated.c)
add_library(generated ${CMAKE_BINARY_DIR}/generated.c)
Now assume you configure the project with Ninja Multi-Config and run
one of the following commands:
ninja -f build-Debug.ninja generated
# OR
cmake --build . --config Debug --target generat.
CMAKE-GENERATORS(7) CMake CMAKE-GENERATORS(7)
NAME
cmake-generators - CMake Generators Reference
INTRODUCTION
A CMake Generator is responsible for writing the input files for a na-
tive build system. Exactly one of the CMake Generators must be se-
lected for a build tree to determine what native build system is to be
used. Optionally one of the Extra Generators may be selected as a
variant of some of the Command-Line Build Tool Generators to produce
project files for an auxiliary IDE.
CMake Generators are platform-specific so each may be available only on
certain platforms. The cmake(1) command-line tool --help output lists
available generators on the current platform. Use its -G option to
specify the generator for a new build tree. The cmake-gui(1) offers
interactive selection of a generator when creating a new build tree.
CMAKE GENERATORS
Command-Line Build Tool Generators
These generators support command-line build tools. In order to use
them, one must launch CMake from a command-line prompt whose environ-
ment is already configured for the chosen compiler and build tool.
Makefile Generators
Borland Makefiles
Generates Borland makefiles.
MSYS Makefiles
Generates makefiles for use with MSYS (Minimal SYStem) make under the
MSYS shell.
Use this generator in a MSYS shell prompt and using make as the build
tool. The generated makefiles use /bin/sh as the shell to launch build
rules. They are not compatible with a Windows command prompt.
To build under a Windows command prompt, use the MinGW Makefiles gener-
ator.
MinGW Makefiles
Generates makefiles for use with mingw32-make under a Windows command
prompt.
Use this generator under a Windows command prompt with MinGW (Minimal-
ist GNU for Windows) in the PATH and using mingw32-make as the build
tool. The generated makefiles use cmd.exe as the shell to launch build
rules. They are not compatible with MSYS or a unix shell.
To build under the MSYS shell, use the MSYS Makefiles generator.
NMake Makefiles
Generates NMake makefiles.
NMake Makefiles JOM
Generates JOM makefiles.
Unix Makefiles
Generates standard UNIX makefiles.
A hierarchy of UNIX makefiles is generated into the build tree. Use
any standard UNIX-style make program to build the project through the
all target and install the project through the install (or in-
stall/strip) target.
For each subdirectory sub/dir of the project a UNIX makefile will be
created, containing the following targets:
all Depends on all targets required by the subdirectory.
install
Runs the install step in the subdirectory, if any.
install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
test Runs the test step in the subdirectory, if any.
package
Runs the package step in the subdirectory, if any.
Watcom WMake
Generates Watcom WMake makefiles.
Ninja Generators
Ninja
Generates build.ninja files.
A build.ninja file is generated into the build tree. Use the ninja
program to build the project through the all target and install the
project through the install (or install/strip) target.
For each subdirectory sub/dir of the project, additional targets are
generated:
sub/dir/all
Depends on all targets required by the subdirectory.
sub/dir/install
Runs the install step in the subdirectory, if any.
sub/dir/install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
sub/dir/test
Runs the test step in the subdirectory, if any.
sub/dir/package
Runs the package step in the subdirectory, if any.
Fortran Support
The Ninja generator conditionally supports Fortran when the ninja tool
is at least version 1.10 (which has the required features).
See Also
The Ninja Multi-Config generator is similar to the Ninja generator, but
generates multiple configurations at once.
Ninja Multi-Config
Generates multiple build-<Config>.ninja files.
This generator is very much like the Ninja generator, but with some key
differences. Only these differences will be discussed in this document.
Unlike the Ninja generator, Ninja Multi-Config generates multiple con-
figurations at once with CMAKE_CONFIGURATION_TYPES instead of only one
configuration with CMAKE_BUILD_TYPE. One build-<Config>.ninja file will
be generated for each of these configurations (with <Config> being the
configuration name.) These files are intended to be run with ninja -f
build-<Config>.ninja. A build.ninja file is also generated, using the
configuration from either CMAKE_DEFAULT_BUILD_TYPE or the first item
from CMAKE_CONFIGURATION_TYPES.
cmake --build . --config <Config> will always use build-<Config>.ninja
to build. If no --config argument is specified, cmake --build . will
default to build-Debug.ninja, unless a build.ninja is generated (see
below), in which case that will be used instead.
Each build-<Config>.ninja file contains <target> targets as well as
<target>:<Config> targets, where <Config> is the same as the configura-
tion specified in build-<Config>.ninja Additionally, if cross-config
mode is enabled, build-<Config>.ninja may contain <target>:<OtherCon-
fig> targets, where <OtherConfig> is a cross-config, as well as <tar-
get>:all, which builds the target in all cross-configs. See below for
how to enable cross-config mode.
The Ninja Multi-Config generator recognizes the following variables:
CMAKE_CONFIGURATION_TYPES
Specifies the total set of configurations to build.
CMAKE_CROSS_CONFIGS
Specifies a semicolon-separated list of configurations available
from all build-<Config>.ninja files.
CMAKE_DEFAULT_BUILD_TYPE
Specifies the configuration to use by default in a build.ninja
file.
CMAKE_DEFAULT_CONFIGS
Specifies a semicolon-separated list of configurations to build
for a target in build.ninja if no :<Config> suffix is specified.
Consider the following example:
cmake_minimum_required(VERSION 3.16)
project(MultiConfigNinja C)
add_executable(generator generator.c)
add_custom_command(OUTPUT generated.c COMMAND generator generated.c)
add_library(generated ${CMAKE_BINARY_DIR}/generated.c)
Now assume you configure the project with Ninja Multi-Config and run
one of the following commands:
ninja -f build-Debug.ninja generated
# OR
cmake --build . --config Debug --target generat.
CMAKE-GENERATORS(7) CMake CMAKE-GENERATORS(7)
NAME
cmake-generators - CMake Generators Reference
INTRODUCTION
A CMake Generator is responsible for writing the input files for a na-
tive build system. Exactly one of the CMake Generators must be se-
lected for a build tree to determine what native build system is to be
used. Optionally one of the Extra Generators may be selected as a
variant of some of the Command-Line Build Tool Generators to produce
project files for an auxiliary IDE.
CMake Generators are platform-specific so each may be available only on
certain platforms. The cmake(1) command-line tool --help output lists
available generators on the current platform. Use its -G option to
specify the generator for a new build tree. The cmake-gui(1) offers
interactive selection of a generator when creating a new build tree.
CMAKE GENERATORS
Command-Line Build Tool Generators
These generators support command-line build tools. In order to use
them, one must launch CMake from a command-line prompt whose environ-
ment is already configured for the chosen compiler and build tool.
Makefile Generators
Borland Makefiles
Generates Borland makefiles.
MSYS Makefiles
Generates makefiles for use with MSYS (Minimal SYStem) make under the
MSYS shell.
Use this generator in a MSYS shell prompt and using make as the build
tool. The generated makefiles use /bin/sh as the shell to launch build
rules. They are not compatible with a Windows command prompt.
To build under a Windows command prompt, use the MinGW Makefiles gener-
ator.
MinGW Makefiles
Generates makefiles for use with mingw32-make under a Windows command
prompt.
Use this generator under a Windows command prompt with MinGW (Minimal-
ist GNU for Windows) in the PATH and using mingw32-make as the build
tool. The generated makefiles use cmd.exe as the shell to launch build
rules. They are not compatible with MSYS or a unix shell.
To build under the MSYS shell, use the MSYS Makefiles generator.
NMake Makefiles
Generates NMake makefiles.
NMake Makefiles JOM
Generates JOM makefiles.
Unix Makefiles
Generates standard UNIX makefiles.
A hierarchy of UNIX makefiles is generated into the build tree. Use
any standard UNIX-style make program to build the project through the
all target and install the project through the install (or in-
stall/strip) target.
For each subdirectory sub/dir of the project a UNIX makefile will be
created, containing the following targets:
all Depends on all targets required by the subdirectory.
install
Runs the install step in the subdirectory, if any.
install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
test Runs the test step in the subdirectory, if any.
package
Runs the package step in the subdirectory, if any.
Watcom WMake
Generates Watcom WMake makefiles.
Ninja Generators
Ninja
Generates build.ninja files.
A build.ninja file is generated into the build tree. Use the ninja
program to build the project through the all target and install the
project through the install (or install/strip) target.
For each subdirectory sub/dir of the project, additional targets are
generated:
sub/dir/all
Depends on all targets required by the subdirectory.
sub/dir/install
Runs the install step in the subdirectory, if any.
sub/dir/install/strip
Runs the install step in the subdirectory followed by a
CMAKE_STRIP command, if any.
The CMAKE_STRIP variable will contain the platforms strip util-
ity, which removes symbols information from generated binaries.
sub/dir/test
Runs the test step in the subdirectory, if any.
sub/dir/package
Runs the package step in the subdirectory, if any.
Fortran Support
The Ninja generator conditionally supports Fortran when the ninja tool
is at least version 1.10 (which has the required features).
See Also
The Ninja Multi-Config generator is similar to the Ninja generator, but
generates multiple configurations at once.
Ninja Multi-Config
Generates multiple build-<Config>.ninja files.
This generator is very much like the Ninja generator, but with some key
differences. Only these differences will be discussed in this document.
Unlike the Ninja generator, Ninja Multi-Config generates multiple con-
figurations at once with CMAKE_CONFIGURATION_TYPES instead of only one
configuration with CMAKE_BUILD_TYPE. One build-<Config>.ninja file will
be generated for each of these configurations (with <Config> being the
configuration name.) These files are intended to be run with ninja -f
build-<Config>.ninja. A build.ninja file is also generated, using the
configuration from either CMAKE_DEFAULT_BUILD_TYPE or the first item
from CMAKE_CONFIGURATION_TYPES.
cmake --build . --config <Config> will always use build-<Config>.ninja
to build. If no --config argument is specified, cmake --build . will
default to build-Debug.ninja, unless a
3.18.4 September 13, 2021 CMAKE-GENERATORS(7)
Czas wygenerowania: 0.00064 sek.
Created with the man page lookup class by Andrew Collington.
Based on a C man page viewer by Vadim Pavlov
Unicode soft-hyphen fix (as used by RedHat) by Dan Edwards
Some optimisations by Eli Argon
Caching idea and code contribution by James Richardson
Copyright © 2003-2025 Linux.pl
Hosted by Hosting Linux.pl