code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Eclipse CDT4 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Kate" href="Kate.html" />
    <link rel="prev" title="CodeLite" href="CodeLite.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Eclipse CDT4

Eclipse CDT4¶

Deprecated since version 3.27: Support for Extra Generators is deprecated and will be removed from
a future version of CMake.  IDEs may use the cmake-file-api(7)
to view CMake-generated project build trees.

Generates Eclipse CDT 4.0 project files.

Project files for Eclipse will be created in the top directory.  In
out of source builds, a linked resource to the top level source
directory will be created.  Additionally a hierarchy of makefiles is
generated into the build tree.  The appropriate make program can build
the project through the default all target.  An install target
is also provided.

This "extra" generator may be specified as:

Eclipse CDT4 - MinGW Makefiles

Generate with MinGW Makefiles.

Eclipse CDT4 - NMake Makefiles

Generate with NMake Makefiles.

Eclipse CDT4 - Ninja

Generate with Ninja.

Eclipse CDT4 - Unix Makefiles

Generate with Unix Makefiles.

Previous topic

CodeLite

Next topic

Kate

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Eclipse CDT4

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Green Hills MULTI — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Xcode" href="Xcode.html" />
    <link rel="prev" title="Visual Studio 17 2022" href="Visual%20Studio%2017%202022.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Green Hills MULTI

Green Hills MULTI¶

New in version 3.3.

New in version 3.15: Linux support.

Generates Green Hills MULTI project files (experimental, work-in-progress).

The buildsystem has predetermined build-configuration settings that can be controlled
via the CMAKE_BUILD_TYPE variable.

Platform Selection¶

New in version 3.13.

The variable GHS_PRIMARY_TARGET can be used to select the target platform.

Sets primaryTarget entry in project file.

For example:

cmake -G "Green Hills MULTI" -D GHS_PRIMARY_TARGET=ppc_integrity.tgt

Otherwise the primaryTarget will be composed from the values of CMAKE_GENERATOR_PLATFORM
and GHS_TARGET_PLATFORM. Defaulting to the value of arm_integrity.tgt

The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option.

Typical values of arm, ppc, 86, etcetera, are used.

The variable GHS_TARGET_PLATFORM may be set, perhaps via the cmake -D
option.

Defaults to integrity.

Usual values are integrity, threadx, uvelosity, velosity,
vxworks, standalone.

For example:

cmake -G "Green Hills MULTI" for arm_integrity.tgt.

cmake -G "Green Hills MULTI" -A 86 for 86_integrity.tgt.

cmake -G "Green Hills MULTI" -D GHS_TARGET_PLATFORM=standalone for arm_standalone.tgt.

cmake -G "Green Hills MULTI" -A ppc -D GHS_TARGET_PLATFORM=standalone for ppc_standalone.tgt.

Toolset Selection¶

New in version 3.13.

The generator searches for the latest compiler or can be given a location to use.
GHS_TOOLSET_ROOT is the directory that is checked for the latest compiler.

The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify the location of the toolset.
Both absolute and relative paths are valid. Paths are relative to GHS_TOOLSET_ROOT.

The variable GHS_TOOLSET_ROOT may be set, perhaps via the cmake -D
option.

Root path for toolset searches and relative paths.

Defaults to C:/ghs in Windows or /usr/ghs in Linux.

For example, setting a specific compiler:

cmake -G "Green Hills MULTI" -T comp_201754 for /usr/ghs/comp_201754.

cmake -G "Green Hills MULTI" -T comp_201754 -D GHS_TOOLSET_ROOT=/opt/ghs for /opt/ghs/comp_201754.

cmake -G "Green Hills MULTI" -T /usr/ghs/comp_201554

cmake -G "Green Hills MULTI" -T C:/ghs/comp_201754

For example, searching for latest compiler:

cmake -G "Green Hills MULTI" for searching /usr/ghs.

cmake -G "Green Hills MULTI -D GHS_TOOLSET_ROOT=/opt/ghs" for searching /opt/ghs.

Note

The CMAKE_GENERATOR_TOOLSET should use CMake style paths.

OS and BSP Selection¶

New in version 3.3.

Certain target platforms, like Integrity, require an OS.  The RTOS directory path
can be explicitly set using GHS_OS_DIR.  Otherwise GHS_OS_ROOT will be
searched for the latest Integrity RTOS.

If the target platform, like Integrity, requires a BSP name then it can be set via
the GHS_BSP_NAME variable.

GHS_OS_DIR and GHS_OS_DIR_OPTION

Sets -os_dir entry in project file.

GHS_OS_DIR_OPTION default value is -os_dir.

New in version 3.15: The GHS_OS_DIR_OPTION variable.

For example:

cmake -G "Green Hills MULTI" -D GHS_OS_DIR=/usr/ghs/int1144

GHS_OS_ROOT

Root path for RTOS searches.

Defaults to C:/ghs in Windows or /usr/ghs in Linux.

For example:

cmake -G "Green Hills MULTI" -D GHS_OS_ROOT=/opt/ghs

GHS_BSP_NAME

Sets -bsp entry in project file.

Defaults to sim<arch> for integrity platforms.

For example:

cmake -G "Green Hills MULTI" for simarm on arm_integrity.tgt.

cmake -G "Green Hills MULTI" -A 86 for sim86 on 86_integrity.tgt.

cmake -G "Green Hills MULTI" -A ppc -D GHS_BSP_NAME=sim800 for sim800
on ppc_integrity.tgt.

cmake -G "Green Hills MULTI" -D GHS_PRIMARY_TARGET=ppc_integrity.tgt -D GHS_BSP_NAME=fsl-t1040
for fsl-t1040 on ppc_integrity.tgt.

Target Properties¶

New in version 3.14.

The following properties are available:

GHS_INTEGRITY_APP

GHS_NO_SOURCE_GROUP_FILE

MULTI Project Variables¶

New in version 3.3.

Adding a Customization file and macros are available through the use of the following
variables:

GHS_CUSTOMIZATION - CMake path name to Customization File.

GHS_GPJ_MACROS - CMake list of Macros.

Note

This generator is deemed experimental as of CMake 3.29.0-rc3
and is still a work in progress.  Future versions of CMake
may make breaking changes as the generator matures.

Table of Contents

Green Hills MULTI

Platform Selection

Toolset Selection

OS and BSP Selection

Target Properties

MULTI Project Variables

Previous topic

Visual Studio 17 2022

Next topic

Xcode

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Green Hills MULTI

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

repo_name: lazytadpole/codenamesilverfish

license: mit


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Kate — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Sublime Text 2" href="Sublime%20Text%202.html" />
    <link rel="prev" title="Eclipse CDT4" href="Eclipse%20CDT4.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Kate

Kate¶

Deprecated since version 3.27: Support for Extra Generators is deprecated and will be removed from
a future version of CMake.  IDEs may use the cmake-file-api(7)
to view CMake-generated project build trees.

Generates Kate project files.

A project file for Kate will be created in the top directory in the top level
build directory.
To use it in Kate, the Project plugin must be enabled.
The project file is loaded in Kate by opening the
ProjectName.kateproject file in the editor.
If the Kate Build-plugin is enabled, all targets generated by CMake are
available for building.

This "extra" generator may be specified as:

Kate - MinGW Makefiles

Generate with MinGW Makefiles.

Kate - NMake Makefiles

Generate with NMake Makefiles.

Kate - Ninja

Generate with Ninja.

Kate - Ninja Multi-Config

Generate with Ninja Multi-Config.

Kate - Unix Makefiles

Generate with Unix Makefiles.

Previous topic

Eclipse CDT4

Next topic

Sublime Text 2

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Kate

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>MSYS Makefiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="MinGW Makefiles" href="MinGW%20Makefiles.html" />
    <link rel="prev" title="Borland Makefiles" href="Borland%20Makefiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

MSYS 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 generator.

Previous topic

Borland Makefiles

Next topic

MinGW Makefiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

MSYS Makefiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>MinGW Makefiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="NMake Makefiles" href="NMake%20Makefiles.html" />
    <link rel="prev" title="MSYS Makefiles" href="MSYS%20Makefiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

MinGW Makefiles

MinGW Makefiles¶

Generates makefiles for use with mingw32-make under a Windows command
prompt.

Use this generator under a Windows command prompt with
MinGW (Minimalist 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.

Previous topic

MSYS Makefiles

Next topic

NMake Makefiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

MinGW Makefiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>NMake Makefiles JOM — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Unix Makefiles" href="Unix%20Makefiles.html" />
    <link rel="prev" title="NMake Makefiles" href="NMake%20Makefiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

NMake Makefiles JOM

NMake Makefiles JOM¶

Generates JOM makefiles.

New in version 3.8: CodeBlocks generator can be used as an extra generator.

Previous topic

NMake Makefiles

Next topic

Unix Makefiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

NMake Makefiles JOM

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>NMake Makefiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="NMake Makefiles JOM" href="NMake%20Makefiles%20JOM.html" />
    <link rel="prev" title="MinGW Makefiles" href="MinGW%20Makefiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

NMake Makefiles

NMake Makefiles¶

Generates NMake makefiles.

Previous topic

MinGW Makefiles

Next topic

NMake Makefiles JOM

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

NMake Makefiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Ninja Multi-Config — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 6" href="Visual%20Studio%206.html" />
    <link rel="prev" title="Ninja" href="Ninja.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Ninja Multi-Config

Ninja Multi-Config¶

New in version 3.17.

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 configurations 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 use build.ninja.

Each build-<Config>.ninja file contains <target> targets as well as
<target>:<Config> targets, where <Config> is the same as the
configuration specified in build-<Config>.ninja Additionally, if
cross-config mode is enabled, build-<Config>.ninja may contain
<target>:<OtherConfig> targets, where <OtherConfig> is a cross-config,
as well as <target>: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. Unlike with other
multi-config generators, this variable has a value of
Debug;Release;RelWithDebInfo by default.

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 generated

This would build the Debug configuration of generator, which would be
used to generate generated.c, which would be used to build the Debug
configuration of generated.

But if CMAKE_CROSS_CONFIGS is set to all, and you run the
following instead:

ninja -f build-Release.ninja generated:Debug
# OR
cmake --build . --config Release --target generated:Debug

This would build the Release configuration of generator, which would be
used to generate generated.c, which would be used to build the Debug
configuration of generated. This is useful for running a release-optimized
version of a generator utility while still building the debug version of the
targets built with the generated code.

Custom Commands¶

New in version 3.20.

The Ninja Multi-Config generator adds extra capabilities to
add_custom_command() and add_custom_target() through its
cross-config mode. The COMMAND, DEPENDS, and WORKING_DIRECTORY
arguments can be evaluated in the context of either the "command config" (the
"native" configuration of the build-<Config>.ninja file in use) or the
"output config" (the configuration used to evaluate the OUTPUT and
BYPRODUCTS).

If either OUTPUT or BYPRODUCTS names a path that is common to
more than one configuration (e.g. it does not use any generator expressions),
all arguments are evaluated in the command config by default.
If all OUTPUT and BYPRODUCTS paths are unique to each configuration
(e.g. by using the $<CONFIG> generator expression), the first argument of
COMMAND is still evaluated in the command config by default, while all
subsequent arguments, as well as the arguments to DEPENDS and
WORKING_DIRECTORY, are evaluated in the output config. These defaults can
be overridden with the $<OUTPUT_CONFIG:...> and $<COMMAND_CONFIG:...>
generator-expressions. Note that if a target is specified by its name in
DEPENDS, or as the first argument of COMMAND, it is always evaluated
in the command config, even if it is wrapped in $<OUTPUT_CONFIG:...>
(because its plain name is not a generator expression).

As an example, consider the following:

add_custom_command(
  OUTPUT "$<CONFIG>.txt"
  COMMAND
    generator "$<CONFIG>.txt"
              "$<OUTPUT_CONFIG:$<CONFIG>>"
              "$<COMMAND_CONFIG:$<CONFIG>>"
  DEPENDS
    tgt1
    "$<TARGET_FILE:tgt2>"
    "$<OUTPUT_CONFIG:$<TARGET_FILE:tgt3>>"
    "$<COMMAND_CONFIG:$<TARGET_FILE:tgt4>>"
  )

Assume that generator, tgt1, tgt2, tgt3, and tgt4 are all
executable targets, and assume that $<CONFIG>.txt is built in the Debug
output config using the Release command config. The Release build of
the generator target is called with Debug.txt Debug Release as
arguments. The command depends on the Release builds of tgt1 and
tgt4, and the Debug builds of tgt2 and tgt3.

PRE_BUILD, PRE_LINK, and POST_BUILD custom commands for targets
only get run in their "native" configuration (the Release configuration in
the build-Release.ninja file) unless they have no BYPRODUCTS or their
BYPRODUCTS are unique per config. Consider the following example:

add_executable(exe main.c)
add_custom_command(
  TARGET exe
  POST_BUILD
  COMMAND
    ${CMAKE_COMMAND} -E echo "Running no-byproduct command"
  )
add_custom_command(
  TARGET exe
  POST_BUILD
  COMMAND
    ${CMAKE_COMMAND} -E echo
    "Running separate-byproduct command for $<CONFIG>"
  BYPRODUCTS $<CONFIG>.txt
  )
add_custom_command(
  TARGET exe
  POST_BUILD
  COMMAND
    ${CMAKE_COMMAND} -E echo
    "Running common-byproduct command for $<CONFIG>"
  BYPRODUCTS exe.txt
  )

In this example, if you build exe:Debug in build-Release.ninja, the
first and second custom commands get run, since their byproducts are unique
per-config, but the last custom command does not. However, if you build
exe:Release in build-Release.ninja, all three custom commands get run.

Table of Contents

Ninja Multi-Config

Custom Commands

Previous topic

Ninja

Next topic

Visual Studio 6

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Ninja Multi-Config

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Ninja — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Ninja Multi-Config" href="Ninja%20Multi-Config.html" />
    <link rel="prev" title="Watcom WMake" href="Watcom%20WMake.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Ninja

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

New in version 3.6: Depends on all targets required by the subdirectory.

sub/dir/install

New in version 3.7: Runs the install step in the subdirectory, if any.

sub/dir/install/strip

New in version 3.7: Runs the install step in the subdirectory followed by a CMAKE_STRIP command,
if any.

The CMAKE_STRIP variable will contain the platform's strip utility, which
removes symbols information from generated binaries.

sub/dir/test

New in version 3.7: Runs the test step in the subdirectory, if any.

sub/dir/package

New in version 3.7: Runs the package step in the subdirectory, if any.

Fortran Support¶

New in version 3.7.

The Ninja generator conditionally supports Fortran when the ninja
tool is at least version 1.10 (which has the required features).

Swift Support¶

New in version 3.15.

The Swift support is experimental, not considered stable, and may change
in future releases of CMake.

See Also¶

New in version 3.17: The Ninja Multi-Config generator is similar to the Ninja
generator, but generates multiple configurations at once.

Table of Contents

Ninja

Fortran Support

Swift Support

See Also

Previous topic

Watcom WMake

Next topic

Ninja Multi-Config

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Ninja

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Sublime Text 2 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="cmake-language(7)" href="../manual/cmake-language.7.html" />
    <link rel="prev" title="Kate" href="Kate.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Sublime Text 2

Sublime Text 2¶

Deprecated since version 3.27: Support for Extra Generators is deprecated and will be removed from
a future version of CMake.  IDEs may use the cmake-file-api(7)
to view CMake-generated project build trees.

Generates Sublime Text 2 project files.

Project files for Sublime Text 2 will be created in the top directory
and in every subdirectory which features a CMakeLists.txt file
containing a project() call.  Additionally Makefiles
(or build.ninja files) are generated into the build tree.
The appropriate make program can build the project through the default all
target.  An install target is also provided.

This "extra" generator may be specified as:

Sublime Text 2 - MinGW Makefiles

Generate with MinGW Makefiles.

Sublime Text 2 - NMake Makefiles

Generate with NMake Makefiles.

Sublime Text 2 - Ninja

Generate with Ninja.

Sublime Text 2 - Unix Makefiles

Generate with Unix Makefiles.

Previous topic

Kate

Next topic

cmake-language(7)

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Sublime Text 2

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Unix Makefiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Watcom WMake" href="Watcom%20WMake.html" />
    <link rel="prev" title="NMake Makefiles JOM" href="NMake%20Makefiles%20JOM.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Unix 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 install/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 platform's strip utility, 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.

Previous topic

NMake Makefiles JOM

Next topic

Watcom WMake

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Unix Makefiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 10 2010 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 11 2012" href="Visual%20Studio%2011%202012.html" />
    <link rel="prev" title="Visual Studio 9 2008" href="Visual%20Studio%209%202008.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 10 2010

Visual Studio 10 2010¶

Removed.  This once generated Visual Studio 10 2010 project files, but
the generator has been removed since CMake 3.25.  It is still possible
to build with VS 10 2010 tools using the Visual Studio 14 2015
(or above) generator with CMAKE_GENERATOR_TOOLSET set to
v100, or by using the NMake Makefiles generator.

Previous topic

Visual Studio 9 2008

Next topic

Visual Studio 11 2012

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 10 2010

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 10 2010.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 11 2012 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 12 2013" href="Visual%20Studio%2012%202013.html" />
    <link rel="prev" title="Visual Studio 10 2010" href="Visual%20Studio%2010%202010.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 11 2012

Visual Studio 11 2012¶

Removed.  This once generated Visual Studio 11 2012 project files, but
the generator has been removed since CMake 3.28.  It is still possible
to build with VS 11 2012 tools using the Visual Studio 14 2015
(or above) generator with CMAKE_GENERATOR_TOOLSET set to v110,
or by using the NMake Makefiles generator.

Previous topic

Visual Studio 10 2010

Next topic

Visual Studio 12 2013

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 11 2012

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 11 2012.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 12 2013 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 14 2015" href="Visual%20Studio%2014%202015.html" />
    <link rel="prev" title="Visual Studio 11 2012" href="Visual%20Studio%2011%202012.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 12 2013

Visual Studio 12 2013¶

Deprecated.  Generates Visual Studio 12 (VS 2013) project files.

Note

This generator is deprecated and will be removed in a future version
of CMake.  It will still be possible to build with VS 12 2013 tools
using the Visual Studio 14 2015 (or above) generator
with CMAKE_GENERATOR_TOOLSET set to v120, or by
using the NMake Makefiles generator.

For compatibility with CMake versions prior to 3.0, one may specify this
generator using the name "Visual Studio 12" without the year component.

Project Types¶

Only Visual C++ and C# projects may be generated (and Fortran with
Intel compiler integration).  Other types of projects (JavaScript,
Powershell, Python, etc.) are not supported.

Platform Selection¶

The default target platform name (architecture) is Win32.

New in version 3.1: The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option, to specify a target platform
name (architecture).  For example:

cmake -G "Visual Studio 12 2013" -A Win32

cmake -G "Visual Studio 12 2013" -A x64

cmake -G "Visual Studio 12 2013" -A ARM

For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
This is supported only for:

Visual Studio 12 2013 Win64

Specify target platform x64.

Visual Studio 12 2013 ARM

Specify target platform ARM.

Toolset Selection¶

The v120 toolset that comes with Visual Studio 12 2013 is selected by
default.  The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify another toolset.

New in version 3.8: For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and
64-bit (x64) hosts (independent of the architecture they target).
By default this generator uses the 32-bit variant even on a 64-bit host.
One may explicitly request use of either the 32-bit or 64-bit host tools
by adding either host=x86 or host=x64 to the toolset specification.
See the CMAKE_GENERATOR_TOOLSET variable for details.

New in version 3.14: Added support for host=x86 option.

Table of Contents

Visual Studio 12 2013

Project Types

Platform Selection

Toolset Selection

Previous topic

Visual Studio 11 2012

Next topic

Visual Studio 14 2015

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 12 2013

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 12 2013.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 14 2015 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 15 2017" href="Visual%20Studio%2015%202017.html" />
    <link rel="prev" title="Visual Studio 12 2013" href="Visual%20Studio%2012%202013.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 14 2015

Visual Studio 14 2015¶

New in version 3.1.

Generates Visual Studio 14 (VS 2015) project files.

Project Types¶

Only Visual C++ and C# projects may be generated (and Fortran with
Intel compiler integration).  Other types of projects (JavaScript,
Powershell, Python, etc.) are not supported.

Platform Selection¶

The default target platform name (architecture) is Win32.

The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option, to specify a target platform
name (architecture).  For example:

cmake -G "Visual Studio 14 2015" -A Win32

cmake -G "Visual Studio 14 2015" -A x64

cmake -G "Visual Studio 14 2015" -A ARM

For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
This is supported only for:

Visual Studio 14 2015 Win64

Specify target platform x64.

Visual Studio 14 2015 ARM

Specify target platform ARM.

Toolset Selection¶

The v140 toolset that comes with Visual Studio 14 2015 is selected by
default.  The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify another toolset.

New in version 3.8: For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and
64-bit (x64) hosts (independent of the architecture they target).
By default this generator uses the 32-bit variant even on a 64-bit host.
One may explicitly request use of either the 32-bit or 64-bit host tools
by adding either host=x86 or host=x64 to the toolset specification.
See the CMAKE_GENERATOR_TOOLSET variable for details.

New in version 3.14: Added support for host=x86 option.

Windows 10 SDK Maximum Version for VS 2015¶

New in version 3.19.

Microsoft stated in a "Windows 10 October 2018 Update" blog post that Windows
10 SDK versions (15063, 16299, 17134, 17763) are not supported by VS 2015 and
are only supported by VS 2017 and later.  Therefore by default CMake
automatically ignores Windows 10 SDKs beyond 10.0.14393.0.

However, there are other recommendations for certain driver/Win32 builds that
indicate otherwise.  A user can override this behavior by either setting the
CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM to a false value
or setting the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM to
the string value of the required maximum (e.g. 10.0.15063.0).

Table of Contents

Visual Studio 14 2015

Project Types

Platform Selection

Toolset Selection

Windows 10 SDK Maximum Version for VS 2015

Previous topic

Visual Studio 12 2013

Next topic

Visual Studio 15 2017

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 14 2015

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 14 2015.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 15 2017 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 16 2019" href="Visual%20Studio%2016%202019.html" />
    <link rel="prev" title="Visual Studio 14 2015" href="Visual%20Studio%2014%202015.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 15 2017

Visual Studio 15 2017¶

New in version 3.7.1.

Generates Visual Studio 15 (VS 2017) project files.

Project Types¶

Only Visual C++ and C# projects may be generated (and Fortran with
Intel compiler integration).  Other types of projects (JavaScript,
Powershell, Python, etc.) are not supported.

Instance Selection¶

New in version 3.11.

VS 2017 supports multiple installations on the same machine.  The
CMAKE_GENERATOR_INSTANCE variable may be used to select one.

Platform Selection¶

The default target platform name (architecture) is Win32.

The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option, to specify a target platform
name (architecture).  For example:

cmake -G "Visual Studio 15 2017" -A Win32

cmake -G "Visual Studio 15 2017" -A x64

cmake -G "Visual Studio 15 2017" -A ARM

cmake -G "Visual Studio 15 2017" -A ARM64

For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
This is supported only for:

Visual Studio 15 2017 Win64

Specify target platform x64.

Visual Studio 15 2017 ARM

Specify target platform ARM.

Toolset Selection¶

The v141 toolset that comes with Visual Studio 15 2017 is selected by
default.  The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify another toolset.

New in version 3.8: For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and
64-bit (x64) hosts (independent of the architecture they target).
By default this generator uses the 32-bit variant even on a 64-bit host.
One may explicitly request use of either the 32-bit or 64-bit host tools
by adding either host=x86 or host=x64 to the toolset specification.
See the CMAKE_GENERATOR_TOOLSET variable for details.

New in version 3.14: Added support for host=x86 option.

Table of Contents

Visual Studio 15 2017

Project Types

Instance Selection

Platform Selection

Toolset Selection

Previous topic

Visual Studio 14 2015

Next topic

Visual Studio 16 2019

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 15 2017

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 15 2017.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 16 2019 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 17 2022" href="Visual%20Studio%2017%202022.html" />
    <link rel="prev" title="Visual Studio 15 2017" href="Visual%20Studio%2015%202017.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 16 2019

Visual Studio 16 2019¶

New in version 3.14.

Generates Visual Studio 16 (VS 2019) project files.

Project Types¶

Only Visual C++ and C# projects may be generated (and Fortran with
Intel compiler integration).  Other types of projects (JavaScript,
Powershell, Python, etc.) are not supported.

Instance Selection¶

VS 2019 supports multiple installations on the same machine.  The
CMAKE_GENERATOR_INSTANCE variable may be used to select one.

Platform Selection¶

The default target platform name (architecture) is that of the host
and is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.

The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option, to specify a target platform
name (architecture).  For example:

cmake -G "Visual Studio 16 2019" -A Win32

cmake -G "Visual Studio 16 2019" -A x64

cmake -G "Visual Studio 16 2019" -A ARM

cmake -G "Visual Studio 16 2019" -A ARM64

Toolset Selection¶

The v142 toolset that comes with Visual Studio 16 2019 is selected by
default.  The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify another toolset.

For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and
64-bit (x64) hosts (independent of the architecture they target).
By default this generator uses the 64-bit variant on x64 hosts and
the 32-bit variant otherwise.
One may explicitly request use of either the 32-bit or 64-bit host tools
by adding either host=x86 or host=x64 to the toolset specification.
See the CMAKE_GENERATOR_TOOLSET variable for details.

Table of Contents

Visual Studio 16 2019

Project Types

Instance Selection

Platform Selection

Toolset Selection

Previous topic

Visual Studio 15 2017

Next topic

Visual Studio 17 2022

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 16 2019

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 16 2019.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 17 2022 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Green Hills MULTI" href="Green%20Hills%20MULTI.html" />
    <link rel="prev" title="Visual Studio 16 2019" href="Visual%20Studio%2016%202019.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 17 2022

Visual Studio 17 2022¶

New in version 3.21.

Generates Visual Studio 17 (VS 2022) project files.

Project Types¶

Only Visual C++ and C# projects may be generated (and Fortran with
Intel compiler integration).  Other types of projects (JavaScript,
Powershell, Python, etc.) are not supported.

Instance Selection¶

VS 2022 supports multiple installations on the same machine.  The
CMAKE_GENERATOR_INSTANCE variable may be used to select one.

Platform Selection¶

The default target platform name (architecture) is that of the host
and is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.

The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option, to specify a target platform
name (architecture).  For example:

cmake -G "Visual Studio 17 2022" -A Win32

cmake -G "Visual Studio 17 2022" -A x64

cmake -G "Visual Studio 17 2022" -A ARM

cmake -G "Visual Studio 17 2022" -A ARM64

Toolset Selection¶

The v143 toolset that comes with VS 17 2022 is selected by default.
The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify another toolset.

For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and
64-bit (x64) hosts (independent of the architecture they target).
By default this generator uses the 64-bit variant on x64 hosts and
the 32-bit variant otherwise.
One may explicitly request use of either the 32-bit or 64-bit host tools
by adding either host=x86 or host=x64 to the toolset specification.
See the CMAKE_GENERATOR_TOOLSET variable for details.

Table of Contents

Visual Studio 17 2022

Project Types

Instance Selection

Platform Selection

Toolset Selection

Previous topic

Visual Studio 16 2019

Next topic

Green Hills MULTI

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 17 2022

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 17 2022.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 6 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 7" href="Visual%20Studio%207.html" />
    <link rel="prev" title="Ninja Multi-Config" href="Ninja%20Multi-Config.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 6

Visual Studio 6¶

Removed.  This once generated Visual Studio 6 project files, but the
generator has been removed since CMake 3.6.  It is still possible to
build with VS 6 tools using the NMake Makefiles generator.

Previous topic

Ninja Multi-Config

Next topic

Visual Studio 7

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 6

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 7 .NET 2003 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 8 2005" href="Visual%20Studio%208%202005.html" />
    <link rel="prev" title="Visual Studio 7" href="Visual%20Studio%207.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 7 .NET 2003

Visual Studio 7 .NET 2003¶

Removed.  This once generated Visual Studio .NET 2003 project files, but
the generator has been removed since CMake 3.9.  It is still possible to
build with VS 7.1 tools using the NMake Makefiles generator.

Previous topic

Visual Studio 7

Next topic

Visual Studio 8 2005

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 7 .NET 2003

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 7 .NET 2003.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 7 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 7 .NET 2003" href="Visual%20Studio%207%20.NET%202003.html" />
    <link rel="prev" title="Visual Studio 6" href="Visual%20Studio%206.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 7

Visual Studio 7¶

Removed.  This once generated Visual Studio .NET 2002 project files, but
the generator has been removed since CMake 3.6.  It is still possible to
build with VS 7.0 tools using the NMake Makefiles generator.

Previous topic

Visual Studio 6

Next topic

Visual Studio 7 .NET 2003

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 7

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 8 2005 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 9 2008" href="Visual%20Studio%209%202008.html" />
    <link rel="prev" title="Visual Studio 7 .NET 2003" href="Visual%20Studio%207%20.NET%202003.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 8 2005

Visual Studio 8 2005¶

Removed.  This once generated Visual Studio 8 2005 project files, but
the generator has been removed since CMake 3.12.  It is still possible to
build with VS 2005 tools using the NMake Makefiles generator.

Previous topic

Visual Studio 7 .NET 2003

Next topic

Visual Studio 9 2008

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 8 2005

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 8 2005.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Visual Studio 9 2008 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Visual Studio 10 2010" href="Visual%20Studio%2010%202010.html" />
    <link rel="prev" title="Visual Studio 8 2005" href="Visual%20Studio%208%202005.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 9 2008

Visual Studio 9 2008¶

Deprecated.  Generates Visual Studio 9 2008 project files.

Note

This generator is deprecated and will be removed in a future version
of CMake.  It will still be possible to build with VS 9 2008 tools
using the Visual Studio 14 2015 generator (or above,
and with VS 10 2010 also installed) with
CMAKE_GENERATOR_TOOLSET set to v90,
or by using the NMake Makefiles generator.

Platform Selection¶

The default target platform name (architecture) is Win32.

New in version 3.1: The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps
via the cmake -A option, to specify a target platform
name (architecture).  For example:

cmake -G "Visual Studio 9 2008" -A Win32

cmake -G "Visual Studio 9 2008" -A x64

cmake -G "Visual Studio 9 2008" -A Itanium

cmake -G "Visual Studio 9 2008" -A <WinCE-SDK>
(Specify a target platform matching a Windows CE SDK name.)

For compatibility with CMake versions prior to 3.1, one may specify
a target platform name optionally at the end of the generator name.
This is supported only for:

Visual Studio 9 2008 Win64

Specify target platform x64.

Visual Studio 9 2008 IA64

Specify target platform Itanium.

Visual Studio 9 2008 <WinCE-SDK>

Specify target platform matching a Windows CE SDK name.

Table of Contents

Visual Studio 9 2008

Platform Selection

Previous topic

Visual Studio 8 2005

Next topic

Visual Studio 10 2010

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Visual Studio 9 2008

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

path: buildtools/windows/cmake/doc/cmake/html/generator/Visual Studio 9 2008.html


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Watcom WMake — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Ninja" href="Ninja.html" />
    <link rel="prev" title="Unix Makefiles" href="Unix%20Makefiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Watcom WMake

Watcom WMake¶

Generates Watcom WMake makefiles.

Previous topic

Unix Makefiles

Next topic

Ninja

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Watcom WMake

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>Xcode — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CodeBlocks" href="CodeBlocks.html" />
    <link rel="prev" title="Green Hills MULTI" href="Green%20Hills%20MULTI.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Xcode

Xcode¶

Generate Xcode project files.

Changed in version 3.15: This generator supports Xcode 5.0 and above.

Toolset and Build System Selection¶

By default Xcode is allowed to select its own default toolchain.
The CMAKE_GENERATOR_TOOLSET option may be set, perhaps
via the cmake -T option, to specify another toolset.

New in version 3.19: This generator supports toolset specification using one of these forms:

toolset

toolset[,key=value]*

key=value[,key=value]*

The toolset specifies the toolset name.  The selected toolset name
is provided in the CMAKE_XCODE_PLATFORM_TOOLSET variable.

The key=value pairs form a comma-separated list of options to
specify generator-specific details of the toolset selection.
Supported pairs are:

buildsystem=<variant>

Specify the buildsystem variant to use.
See the CMAKE_XCODE_BUILD_SYSTEM variable for allowed values.

For example, to select the original build system under Xcode 12,
run cmake(1) with the option -T buildsystem=1.

Swift Support¶

New in version 3.4.

When using the Xcode generator with Xcode 6.1 or higher,
one may enable the Swift language with the enable_language()
command or the project().

Limitations¶

The Xcode generator does not support per-configuration sources.
Code like the following will result in a generation error:

add_executable(MyApp mymain-$<CONFIG>.cpp)

Table of Contents

Xcode

Toolset and Build System Selection

Swift Support

Limitations

Previous topic

Green Hills MULTI

Next topic

CodeBlocks

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-generators(7) »

Xcode

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>IDE Integration Guide — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/cmake.css" />

    <link rel="icon" href="../../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="CMake Release Notes" href="../../release/index.html" />
    <link rel="prev" title="Importing and Exporting Guide" href="../importing-exporting/index.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

IDE Integration Guide

IDE Integration Guide¶

Contents

IDE Integration Guide

Introduction

Bundling

Presets

Configuring

Building

Testing

IDEs with CMake integration

Introduction¶

Integrated development environments (IDEs) may want to integrate with CMake to
improve the development experience for CMake users. This document lays out the
recommended best practices for such integration.

Bundling¶

Many IDE vendors will want to bundle a copy of CMake with their IDE. IDEs that
bundle CMake should present the user with the option of using an external CMake
installation instead of the bundled one, in case the bundled copy becomes
outdated and the user wants to use a newer version.

While IDE vendors may be tempted to bundle different versions of CMake with
their application, such practice is not recommended. CMake has strong
guarantees of backwards compatibility, and there is no reason not to use a
newer version of CMake than what a project requires, or indeed, the very latest
version. Therefore, it is recommended that IDE vendors that bundle CMake with
their application always include the very latest patch version of CMake
available at the time of release.

As a suggestion, IDEs may also ship a copy of the Ninja buildsystem alongside
CMake. Ninja is highly performant and well-supported on all platforms that
support CMake. IDEs that bundle Ninja should use Ninja 1.10 or later, which
contains features needed to support Fortran builds.

Presets¶

CMake supports a file format called CMakePresets.json, and its
user-specific counterpart, CMakeUserPresets.json. This file contains
information on the various configure presets that a user may want. Each preset
may have a different compiler, build flags, etc. The details of this format are
explained in the cmake(1) manual.

IDE vendors are encouraged to read and evaluate this file the same way CMake
does, and present the user with the presets listed in the file. Users should be
able to see (and possibly edit) the CMake cache variables, environment
variables, and command line options that are defined for a given preset. The
IDE should then construct the list of appropriate cmake(1) command
line arguments based on these settings, rather than using the
--preset= option directly. The
--preset= option is intended only as a convenient
frontend for command line users, and should not be used by the IDE.

For example, if a preset named ninja specifies Ninja as the generator
and ${sourceDir}/build as the build directory, instead of running:

cmake -S /path/to/source --preset=ninja

the IDE should instead calculate the settings of the ninja preset, and then
run:

cmake -S /path/to/source -B /path/to/source/build -G Ninja

In cases where a preset contains lots of cache variables, and passing all of
them as -D flags would cause the command line length limit
of the platform to be exceeded, the IDE should instead construct a temporary
cache script and pass it with the -C flag.

While reading, parsing, and evaluating the contents of CMakePresets.json is
straightforward, it is not trivial. In addition to the documentation, IDE
vendors may also wish to refer to the CMake source code and test cases for a
better understanding of how to implement the format.
This file provides a
machine-readable JSON schema for the CMakePresets.json format that IDE
vendors may find useful for validation and providing editing assistance.

Configuring¶

IDEs that invoke cmake(1) to run the configure step may wish to
receive information about the artifacts that the build will produce, as well
as the include directories, compile definitions, etc. used to build the
artifacts. Such information can be obtained by using the
File API. The manual page for the File API
contains more information about the API and how to invoke it.
Server mode was removed as of CMake 3.20 and
should not be used on CMake 3.14 or later.

IDEs should avoid creating more build trees than necessary, and only create
multiple build trees if the user wishes to switch to a different compiler,
use different compile flags, etc. In particular, IDEs should NOT create
multiple single-config build trees which all have the same properties except
for a differing CMAKE_BUILD_TYPE, effectively creating a
multi-config environment. Instead, the Ninja Multi-Config
generator, in conjunction with the File API to
get the list of build configurations, should be used for this purpose.

IDEs should not use the "extra generators" with Makefile or Ninja generators,
which generate IDE project files in addition to the Makefile or Ninja files.
Instead the File API should be used to get the
list of build artifacts.

Building¶

If a Makefile or Ninja generator is used to generate the build tree, it is not
recommended to invoke make or ninja directly. Instead, it is
recommended that the IDE invoke cmake(1) with the
--build argument, which will in turn invoke the
appropriate build tool.

If an IDE project generator is used, such as Xcode or one of the
Visual Studio generators, and the IDE understands the project format used, the
IDE should read the project file and build it the same way it would otherwise.

The File API can be used to obtain a list of
build configurations from the build tree, and the IDE should present this list
to the user to select a build configuration.

Testing¶

ctest(1) supports outputting a JSON format with information about the
available tests and test configurations. IDEs which want to run CTest should
obtain this information and use it to present the user with a list of tests.

IDEs should not invoke the test target of the generated buildsystem.
Instead, they should invoke ctest(1) directly.

IDEs with CMake integration¶

The following IDEs support CMake natively:

CLion

KDevelop

QtCreator

Vim (via a plugin)

Visual Studio

VSCode (via a plugin)

Additionally, CMake has builtin support for some IDEs:

IDE Build Tool Generators:
Generate IDE native build systems such as Visual Studio or Xcode.

Extra Generators:
Extend Command-Line Build Tool Generators to generate IDE
project files that hook into the command-line build system.
Superseded by the File API.

Table of Contents

IDE Integration Guide

Introduction

Bundling

Presets

Configuring

Building

Testing

IDEs with CMake integration

Previous topic

Importing and Exporting Guide

Next topic

CMake Release Notes

This Page

Show Source

Quick search

    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

IDE Integration Guide

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.