1CMAKE-GENERATORS(7)                  CMake                 CMAKE-GENERATORS(7)
2
3
4

NAME

6       cmake-generators - CMake Generators Reference
7

INTRODUCTION

9       A  CMake Generator is responsible for writing the input files for a na‐
10       tive build system.  Exactly one of the CMake  Generators  must  be  se‐
11       lected  for a build tree to determine what native build system is to be
12       used.  Optionally one of the Extra Generators  may  be  selected  as  a
13       variant  of  some  of the Command-Line Build Tool Generators to produce
14       project files for an auxiliary IDE.
15
16       CMake Generators are platform-specific so each may be available only on
17       certain  platforms.  The cmake(1) command-line tool --help output lists
18       available generators on the current platform.  Use  its  -G  option  to
19       specify the generator for a new build tree. The cmake-gui(1) offers in‐
20       teractive selection of a generator when creating a new build tree.
21

CMAKE GENERATORS

23   Command-Line Build Tool Generators
24       These generators support command-line build tools.   In  order  to  use
25       them,  one  must launch CMake from a command-line prompt whose environ‐
26       ment is already configured for the chosen compiler and build tool.
27
28   Makefile Generators
29   Borland Makefiles
30       Generates Borland makefiles.
31
32   MSYS Makefiles
33       Generates makefiles for use with MSYS (Minimal SYStem) make  under  the
34       MSYS shell.
35
36       Use  this  generator in a MSYS shell prompt and using make as the build
37       tool.  The generated makefiles use /bin/sh as the shell to launch build
38       rules.  They are not compatible with a Windows command prompt.
39
40       To build under a Windows command prompt, use the MinGW Makefiles gener‐
41       ator.
42
43   MinGW Makefiles
44       Generates makefiles for use with mingw32-make under a  Windows  command
45       prompt.
46
47       Use  this generator under a Windows command prompt with MinGW (Minimal‐
48       ist GNU for Windows) in the PATH and using mingw32-make  as  the  build
49       tool.  The generated makefiles use cmd.exe as the shell to launch build
50       rules.  They are not compatible with MSYS or a unix shell.
51
52       To build under the MSYS shell, use the MSYS Makefiles generator.
53
54   NMake Makefiles
55       Generates NMake makefiles.
56
57   NMake Makefiles JOM
58       Generates JOM makefiles.
59
60       New in version 3.8: CodeBlocks generator can be used as an extra gener‐
61       ator.
62
63
64   Unix Makefiles
65       Generates standard UNIX makefiles.
66
67       A  hierarchy  of  UNIX makefiles is generated into the build tree.  Use
68       any standard UNIX-style make program to build the project  through  the
69       all  target  and  install  the  project  through  the  install  (or in‐
70       stall/strip) target.
71
72       For each subdirectory sub/dir of the project a UNIX  makefile  will  be
73       created, containing the following targets:
74
75       all    Depends on all targets required by the subdirectory.
76
77       install
78              Runs the install step in the subdirectory, if any.
79
80       install/strip
81              Runs  the  install  step  in  the  subdirectory  followed  by  a
82              CMAKE_STRIP command, if any.
83
84              The CMAKE_STRIP variable will contain the platform's strip util‐
85              ity, which removes symbols information from generated binaries.
86
87       test   Runs the test step in the subdirectory, if any.
88
89       package
90              Runs the package step in the subdirectory, if any.
91
92   Watcom WMake
93       Generates Watcom WMake makefiles.
94
95   Ninja Generators
96   Ninja
97       Generates build.ninja files.
98
99       A  build.ninja  file  is  generated into the build tree.  Use the ninja
100       program to build the project through the all  target  and  install  the
101       project through the install (or install/strip) target.
102
103       For  each  subdirectory  sub/dir of the project, additional targets are
104       generated:
105
106       sub/dir/all
107          New in version 3.6: Depends on all targets required by the subdirec‐
108          tory.
109
110
111       sub/dir/install
112          New  in  version  3.7: Runs the install step in the subdirectory, if
113          any.
114
115
116       sub/dir/install/strip
117          New in version 3.7: Runs the install step in the  subdirectory  fol‐
118          lowed by a CMAKE_STRIP command, if any.
119
120          The  CMAKE_STRIP variable will contain the platform's strip utility,
121          which removes symbols information from generated binaries.
122
123
124       sub/dir/test
125          New in version 3.7: Runs the test step in the subdirectory, if any.
126
127
128       sub/dir/package
129          New in version 3.7: Runs the package step in  the  subdirectory,  if
130          any.
131
132
133   Fortran Support
134       New in version 3.7.
135
136
137       The  Ninja generator conditionally supports Fortran when the ninja tool
138       is at least version 1.10 (which has the required features).
139
140   Swift Support
141       New in version 3.15.
142
143
144       The Swift support is  experimental,  not  considered  stable,  and  may
145       change in future releases of CMake.
146
147   See Also
148       New in version 3.17: The Ninja Multi-Config generator is similar to the
149       Ninja generator, but generates multiple configurations at once.
150
151
152   Ninja Multi-Config
153       New in version 3.17.
154
155
156       Generates multiple build-<Config>.ninja files.
157
158       This generator is very much like the Ninja generator, but with some key
159       differences. Only these differences will be discussed in this document.
160
161       Unlike  the Ninja generator, Ninja Multi-Config generates multiple con‐
162       figurations at once with CMAKE_CONFIGURATION_TYPES instead of only  one
163       configuration with CMAKE_BUILD_TYPE. One build-<Config>.ninja file will
164       be generated for each of these configurations (with <Config> being  the
165       configuration  name.)  These files are intended to be run with ninja -f
166       build-<Config>.ninja. A build.ninja file is also generated,  using  the
167       configuration  from  either  CMAKE_DEFAULT_BUILD_TYPE or the first item
168       from CMAKE_CONFIGURATION_TYPES.
169
170       cmake --build . --config <Config> will always use  build-<Config>.ninja
171       to  build.  If  no --config argument is specified, cmake --build . will
172       use build.ninja.
173
174       Each build-<Config>.ninja file contains <target>  targets  as  well  as
175       <target>:<Config> targets, where <Config> is the same as the configura‐
176       tion specified in build-<Config>.ninja  Additionally,  if  cross-config
177       mode  is  enabled, build-<Config>.ninja may contain <target>:<OtherCon‐
178       fig> targets, where <OtherConfig> is a cross-config, as well  as  <tar‐
179       get>:all,  which  builds the target in all cross-configs. See below for
180       how to enable cross-config mode.
181
182       The Ninja Multi-Config generator recognizes the following variables:
183
184       CMAKE_CONFIGURATION_TYPES
185              Specifies the total set of configurations to build. Unlike  with
186              other  multi-config generators, this variable has a value of De‐
187              bug;Release;RelWithDebInfo by default.
188
189       CMAKE_CROSS_CONFIGS
190              Specifies a semicolon-separated list of configurations available
191              from all build-<Config>.ninja files.
192
193       CMAKE_DEFAULT_BUILD_TYPE
194              Specifies  the  configuration to use by default in a build.ninja
195              file.
196
197       CMAKE_DEFAULT_CONFIGS
198              Specifies a semicolon-separated list of configurations to  build
199              for a target in build.ninja if no :<Config> suffix is specified.
200
201       Consider the following example:
202
203          cmake_minimum_required(VERSION 3.16)
204          project(MultiConfigNinja C)
205
206          add_executable(generator generator.c)
207          add_custom_command(OUTPUT generated.c COMMAND generator generated.c)
208          add_library(generated ${CMAKE_BINARY_DIR}/generated.c)
209
210       Now  assume  you  configure the project with Ninja Multi-Config and run
211       one of the following commands:
212
213          ninja -f build-Debug.ninja generated
214          # OR
215          cmake --build . --config Debug --target generated
216
217       This would build the Debug configuration of generator, which  would  be
218       used  to  generate  generated.c, which would be used to build the Debug
219       configuration of generated.
220
221       But if CMAKE_CROSS_CONFIGS is set to all, and you run the following in‐
222       stead:
223
224          ninja -f build-Release.ninja generated:Debug
225          # OR
226          cmake --build . --config Release --target generated:Debug
227
228       This would build the Release configuration of generator, which would be
229       used to generate generated.c, which would be used to  build  the  Debug
230       configuration  of generated. This is useful for running a release-opti‐
231       mized version of a generator utility while  still  building  the  debug
232       version of the targets built with the generated code.
233
234   Custom Commands
235       New in version 3.20.
236
237
238       The   Ninja   Multi-Config   generator   adds   extra  capabilities  to
239       add_custom_command() and add_custom_target() through  its  cross-config
240       mode.  The  COMMAND,  DEPENDS,  and  WORKING_DIRECTORY arguments can be
241       evaluated in the context of either the "command config"  (the  "native"
242       configuration  of  the build-<Config>.ninja file in use) or the "output
243       config" (the configuration used to evaluate the OUTPUT and BYPRODUCTS).
244
245       If either OUTPUT or BYPRODUCTS names a path that is common to more than
246       one configuration (e.g. it does not use any generator expressions), all
247       arguments are evaluated in the command config by default.  If all  OUT‐
248       PUT  and BYPRODUCTS paths are unique to each configuration (e.g. by us‐
249       ing the $<CONFIG> generator expression), the first argument of  COMMAND
250       is  still  evaluated in the command config by default, while all subse‐
251       quent arguments, as well as the arguments to DEPENDS and WORKING_DIREC‐
252       TORY,  are  evaluated in the output config. These defaults can be over‐
253       ridden with the $<OUTPUT_CONFIG:...> and $<COMMAND_CONFIG:...>  genera‐
254       tor-expressions.  Note that if a target is specified by its name in DE‐
255       PENDS, or as the first argument of COMMAND, it is always  evaluated  in
256       the  command config, even if it is wrapped in $<OUTPUT_CONFIG:...> (be‐
257       cause its plain name is not a generator expression).
258
259       As an example, consider the following:
260
261          add_custom_command(
262            OUTPUT "$<CONFIG>.txt"
263            COMMAND generator "$<CONFIG>.txt" "$<OUTPUT_CONFIG:$<CONFIG>>" "$<COMMAND_CONFIG:$<CONFIG>>"
264            DEPENDS tgt1 "$<TARGET_FILE:tgt2>" "$<OUTPUT_CONFIG:$<TARGET_FILE:tgt3>>" "$<COMMAND_CONFIG:$<TARGET_FILE:tgt4>>"
265            )
266
267       Assume that generator, tgt1, tgt2, tgt3, and tgt4  are  all  executable
268       targets,  and  assume  that  $<CONFIG>.txt is built in the Debug output
269       config using the Release command config. The Release build of the  gen‐
270       erator  target is called with Debug.txt Debug Release as arguments. The
271       command depends on the Release builds of tgt1 and tgt4, and  the  Debug
272       builds of tgt2 and tgt3.
273
274       PRE_BUILD,  PRE_LINK,  and  POST_BUILD custom commands for targets only
275       get run in their "native" configuration (the Release  configuration  in
276       the  build-Release.ninja  file) unless they have no BYPRODUCTS or their
277       BYPRODUCTS are unique per config. Consider the following example:
278
279          add_executable(exe main.c)
280          add_custom_command(
281            TARGET exe
282            POST_BUILD
283            COMMAND ${CMAKE_COMMAND} -E echo "Running no-byproduct command"
284            )
285          add_custom_command(
286            TARGET exe
287            POST_BUILD
288            COMMAND ${CMAKE_COMMAND} -E echo "Running separate-byproduct command for $<CONFIG>"
289            BYPRODUCTS $<CONFIG>.txt
290            )
291          add_custom_command(
292            TARGET exe
293            POST_BUILD
294            COMMAND ${CMAKE_COMMAND} -E echo "Running common-byproduct command for $<CONFIG>"
295            BYPRODUCTS exe.txt
296            )
297
298       In this example, if you build  exe:Debug  in  build-Release.ninja,  the
299       first  and  second  custom commands get run, since their byproducts are
300       unique per-config, but the last custom command does  not.  However,  if
301       you build exe:Release in build-Release.ninja, all three custom commands
302       get run.
303
304   IDE Build Tool Generators
305       These  generators  support  Integrated  Development  Environment  (IDE)
306       project  files.  Since the IDEs configure their own environment one may
307       launch CMake from any environment.
308
309   Visual Studio Generators
310   Visual Studio 6
311       Removed.  This once generated Visual Studio 6 project  files,  but  the
312       generator  has  been  removed since CMake 3.6.  It is still possible to
313       build with VS 6 tools using the NMake Makefiles generator.
314
315   Visual Studio 7
316       Removed.  This once generated Visual Studio .NET  2002  project  files,
317       but the generator has been removed since CMake 3.6.  It is still possi‐
318       ble to build with VS 7.0 tools using the NMake Makefiles generator.
319
320   Visual Studio 7 .NET 2003
321       Removed.  This once generated Visual Studio .NET  2003  project  files,
322       but the generator has been removed since CMake 3.9.  It is still possi‐
323       ble to build with VS 7.1 tools using the NMake Makefiles generator.
324
325   Visual Studio 8 2005
326       Removed.  This once generated Visual Studio 8 2005 project  files,  but
327       the  generator has been removed since CMake 3.12.  It is still possible
328       to build with VS 2005 tools using the NMake Makefiles generator.
329
330   Visual Studio 9 2008
331       Generates Visual Studio 9 2008 project files.
332
333   Platform Selection
334       The default target platform name (architecture) is Win32.
335
336       New in version 3.1: The CMAKE_GENERATOR_PLATFORM variable may  be  set,
337       perhaps via the cmake -A option, to specify a target platform name (ar‐
338       chitecture).  For example:
339
340cmake -G "Visual Studio 9 2008" -A Win32
341
342cmake -G "Visual Studio 9 2008" -A x64
343
344cmake -G "Visual Studio 9 2008" -A Itanium
345
346cmake -G "Visual Studio 9 2008"  -A  <WinCE-SDK>  (Specify  a  target
347         platform matching a Windows CE SDK name.)
348
349
350       For  compatibility  with CMake versions prior to 3.1, one may specify a
351       target platform name optionally at the end of the generator name.  This
352       is supported only for:
353
354       Visual Studio 9 2008 Win64
355              Specify target platform x64.
356
357       Visual Studio 9 2008 IA64
358              Specify target platform Itanium.
359
360       Visual Studio 9 2008 <WinCE-SDK>
361              Specify target platform matching a Windows CE SDK name.
362
363   Visual Studio 10 2010
364       Removed.   This once generated Visual Studio 10 2010 project files, but
365       the generator has been removed since CMake 3.25.  It is still  possible
366       to  build  with  VS  10  2010 tools using the Visual Studio 12 2013 (or
367       above) generator with CMAKE_GENERATOR_TOOLSET set to v100, or by  using
368       the NMake Makefiles generator.
369
370   Visual Studio 11 2012
371       Deprecated.  Generates Visual Studio 11 (VS 2012) project files.
372
373       NOTE:
374          This generator is deprecated and will be removed in a future version
375          of CMake.  It will still be possible to build with VS 11 2012  tools
376          using   the   Visual  Studio  12  2013  (or  above)  generator  with
377          CMAKE_GENERATOR_TOOLSET set to v110, or by using the NMake Makefiles
378          generator.
379
380       For  compatibility  with  CMake  versions prior to 3.0, one may specify
381       this generator using the name "Visual Studio 11" without the year  com‐
382       ponent.
383
384   Project Types
385       Only  Visual C++ and C# projects may be generated (and Fortran with In‐
386       tel compiler integration).  Other types of projects (JavaScript,  Data‐
387       base, Website, etc.) are not supported.
388
389   Platform Selection
390       The default target platform name (architecture) is Win32.
391
392       New  in  version 3.1: The CMAKE_GENERATOR_PLATFORM variable may be set,
393       perhaps via the cmake -A option, to specify a target platform name (ar‐
394       chitecture).  For example:
395
396cmake -G "Visual Studio 11 2012" -A Win32
397
398cmake -G "Visual Studio 11 2012" -A x64
399
400cmake -G "Visual Studio 11 2012" -A ARM
401
402cmake  -G  "Visual  Studio  11 2012" -A <WinCE-SDK> (Specify a target
403         platform matching a Windows CE SDK name.)
404
405
406       For compatibility with CMake versions prior to 3.1, one may  specify  a
407       target platform name optionally at the end of the generator name.  This
408       is supported only for:
409
410       Visual Studio 11 2012 Win64
411              Specify target platform x64.
412
413       Visual Studio 11 2012 ARM
414              Specify target platform ARM.
415
416       Visual Studio 11 2012 <WinCE-SDK>
417              Specify target platform matching a Windows CE SDK name.
418
419   Toolset Selection
420       The v110 toolset that comes with Visual Studio 11 2012 is  selected  by
421       default.   The  CMAKE_GENERATOR_TOOLSET  option may be set, perhaps via
422       the cmake -T option, to specify another toolset.
423
424   Visual Studio 12 2013
425       Generates Visual Studio 12 (VS 2013) project files.
426
427       For compatibility with CMake versions prior to  3.0,  one  may  specify
428       this  generator using the name "Visual Studio 12" without the year com‐
429       ponent.
430
431   Project Types
432       Only Visual C++ and C# projects may be generated (and Fortran with  In‐
433       tel compiler integration).  Other types of projects (JavaScript, Power‐
434       shell, Python, etc.) are not supported.
435
436   Platform Selection
437       The default target platform name (architecture) is Win32.
438
439       New in version 3.1: The CMAKE_GENERATOR_PLATFORM variable may  be  set,
440       perhaps via the cmake -A option, to specify a target platform name (ar‐
441       chitecture).  For example:
442
443cmake -G "Visual Studio 12 2013" -A Win32
444
445cmake -G "Visual Studio 12 2013" -A x64
446
447cmake -G "Visual Studio 12 2013" -A ARM
448
449
450       For compatibility with CMake versions prior to 3.1, one may  specify  a
451       target platform name optionally at the end of the generator name.  This
452       is supported only for:
453
454       Visual Studio 12 2013 Win64
455              Specify target platform x64.
456
457       Visual Studio 12 2013 ARM
458              Specify target platform ARM.
459
460   Toolset Selection
461       The v120 toolset that comes with Visual Studio 12 2013 is  selected  by
462       default.   The  CMAKE_GENERATOR_TOOLSET  option may be set, perhaps via
463       the cmake -T option, to specify another toolset.
464
465       New in version 3.8: For each toolset that comes with  this  version  of
466       Visual  Studio,  there  are  variants  that are themselves compiled for
467       32-bit (x86) and 64-bit (x64) hosts (independent  of  the  architecture
468       they  target).   By default this generator uses the 32-bit variant even
469       on a 64-bit host.  One may explicitly request use of either the  32-bit
470       or  64-bit  host  tools  by  adding  either host=x86 or host=x64 to the
471       toolset specification.  See the  CMAKE_GENERATOR_TOOLSET  variable  for
472       details.
473
474
475       New in version 3.14: Added support for host=x86 option.
476
477
478   Visual Studio 14 2015
479       New in version 3.1.
480
481
482       Generates Visual Studio 14 (VS 2015) project files.
483
484   Project Types
485       Only  Visual C++ and C# projects may be generated (and Fortran with In‐
486       tel compiler integration).  Other types of projects (JavaScript, Power‐
487       shell, Python, etc.) are not supported.
488
489   Platform Selection
490       The default target platform name (architecture) is Win32.
491
492       The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps via the cmake
493       -A option, to specify a target platform name (architecture).  For exam‐
494       ple:
495
496cmake -G "Visual Studio 14 2015" -A Win32
497
498cmake -G "Visual Studio 14 2015" -A x64
499
500cmake -G "Visual Studio 14 2015" -A ARM
501
502       For  compatibility  with CMake versions prior to 3.1, one may specify a
503       target platform name optionally at the end of the generator name.  This
504       is supported only for:
505
506       Visual Studio 14 2015 Win64
507              Specify target platform x64.
508
509       Visual Studio 14 2015 ARM
510              Specify target platform ARM.
511
512   Toolset Selection
513       The  v140  toolset that comes with Visual Studio 14 2015 is selected by
514       default.  The CMAKE_GENERATOR_TOOLSET option may be  set,  perhaps  via
515       the cmake -T option, to specify another toolset.
516
517       New  in  version  3.8: For each toolset that comes with this version of
518       Visual Studio, there are variants  that  are  themselves  compiled  for
519       32-bit  (x86)  and  64-bit (x64) hosts (independent of the architecture
520       they target).  By default this generator uses the 32-bit  variant  even
521       on  a 64-bit host.  One may explicitly request use of either the 32-bit
522       or 64-bit host tools by adding  either  host=x86  or  host=x64  to  the
523       toolset  specification.   See  the CMAKE_GENERATOR_TOOLSET variable for
524       details.
525
526
527       New in version 3.14: Added support for host=x86 option.
528
529
530   Windows 10 SDK Maximum Version for VS 2015
531       New in version 3.19.
532
533
534       Microsoft stated in a "Windows 10 October 2018 Update" blog  post  that
535       Windows  10 SDK versions (15063, 16299, 17134, 17763) are not supported
536       by VS 2015 and are only supported by VS 2017 and later.   Therefore  by
537       default   CMake   automatically   ignores   Windows   10   SDKs  beyond
538       10.0.14393.0.
539
540       However, there  are  other  recommendations  for  certain  driver/Win32
541       builds  that  indicate otherwise.  A user can override this behavior by
542       either setting the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM  to
543       a          false          value          or         setting         the
544       CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM to the string value of
545       the required maximum (e.g. 10.0.15063.0).
546
547   Visual Studio 15 2017
548       New in version 3.7.1.
549
550
551       Generates Visual Studio 15 (VS 2017) project files.
552
553   Project Types
554       Only  Visual C++ and C# projects may be generated (and Fortran with In‐
555       tel compiler integration).  Other types of projects (JavaScript, Power‐
556       shell, Python, etc.) are not supported.
557
558   Instance Selection
559       New in version 3.11.
560
561
562       VS  2017  supports  multiple  installations  on  the same machine.  The
563       CMAKE_GENERATOR_INSTANCE variable may be used to select one.
564
565   Platform Selection
566       The default target platform name (architecture) is Win32.
567
568       The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps via the cmake
569       -A option, to specify a target platform name (architecture).  For exam‐
570       ple:
571
572cmake -G "Visual Studio 15 2017" -A Win32
573
574cmake -G "Visual Studio 15 2017" -A x64
575
576cmake -G "Visual Studio 15 2017" -A ARM
577
578cmake -G "Visual Studio 15 2017" -A ARM64
579
580       For compatibility with CMake versions prior to 3.1, one may  specify  a
581       target platform name optionally at the end of the generator name.  This
582       is supported only for:
583
584       Visual Studio 15 2017 Win64
585              Specify target platform x64.
586
587       Visual Studio 15 2017 ARM
588              Specify target platform ARM.
589
590   Toolset Selection
591       The v141 toolset that comes with Visual Studio 15 2017 is  selected  by
592       default.   The  CMAKE_GENERATOR_TOOLSET  option may be set, perhaps via
593       the cmake -T option, to specify another toolset.
594
595       New in version 3.8: For each toolset that comes with  this  version  of
596       Visual  Studio,  there  are  variants  that are themselves compiled for
597       32-bit (x86) and 64-bit (x64) hosts (independent  of  the  architecture
598       they  target).   By default this generator uses the 32-bit variant even
599       on a 64-bit host.  One may explicitly request use of either the  32-bit
600       or  64-bit  host  tools  by  adding  either host=x86 or host=x64 to the
601       toolset specification.  See the  CMAKE_GENERATOR_TOOLSET  variable  for
602       details.
603
604
605       New in version 3.14: Added support for host=x86 option.
606
607
608   Visual Studio 16 2019
609       New in version 3.14.
610
611
612       Generates Visual Studio 16 (VS 2019) project files.
613
614   Project Types
615       Only  Visual C++ and C# projects may be generated (and Fortran with In‐
616       tel compiler integration).  Other types of projects (JavaScript, Power‐
617       shell, Python, etc.) are not supported.
618
619   Instance Selection
620       VS  2019  supports  multiple  installations  on  the same machine.  The
621       CMAKE_GENERATOR_INSTANCE variable may be used to select one.
622
623   Platform Selection
624       The default target platform name (architecture) is that of the host and
625       is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.
626
627       The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps via the cmake
628       -A option, to specify a target platform name (architecture).  For exam‐
629       ple:
630
631cmake -G "Visual Studio 16 2019" -A Win32
632
633cmake -G "Visual Studio 16 2019" -A x64
634
635cmake -G "Visual Studio 16 2019" -A ARM
636
637cmake -G "Visual Studio 16 2019" -A ARM64
638
639   Toolset Selection
640       The  v142  toolset that comes with Visual Studio 16 2019 is selected by
641       default.  The CMAKE_GENERATOR_TOOLSET option may be  set,  perhaps  via
642       the cmake -T option, to specify another toolset.
643
644       For  each  toolset that comes with this version of Visual Studio, there
645       are variants that are themselves compiled for 32-bit (x86)  and  64-bit
646       (x64)  hosts (independent of the architecture they target).  By default
647       this generator uses the 64-bit variant on  x64  hosts  and  the  32-bit
648       variant otherwise.  One may explicitly request use of either the 32-bit
649       or 64-bit host tools by adding  either  host=x86  or  host=x64  to  the
650       toolset  specification.   See  the CMAKE_GENERATOR_TOOLSET variable for
651       details.
652
653   Visual Studio 17 2022
654       New in version 3.21.
655
656
657       Generates Visual Studio 17 (VS 2022) project files.
658
659   Project Types
660       Only Visual C++ and C# projects may be generated (and Fortran with  In‐
661       tel compiler integration).  Other types of projects (JavaScript, Power‐
662       shell, Python, etc.) are not supported.
663
664   Instance Selection
665       VS 2022 supports multiple  installations  on  the  same  machine.   The
666       CMAKE_GENERATOR_INSTANCE variable may be used to select one.
667
668   Platform Selection
669       The default target platform name (architecture) is that of the host and
670       is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.
671
672       The CMAKE_GENERATOR_PLATFORM variable may be set, perhaps via the cmake
673       -A option, to specify a target platform name (architecture).  For exam‐
674       ple:
675
676cmake -G "Visual Studio 17 2022" -A Win32
677
678cmake -G "Visual Studio 17 2022" -A x64
679
680cmake -G "Visual Studio 17 2022" -A ARM
681
682cmake -G "Visual Studio 17 2022" -A ARM64
683
684   Toolset Selection
685       The v143 toolset that comes with VS 17 2022  is  selected  by  default.
686       The CMAKE_GENERATOR_TOOLSET option may be set, perhaps via the cmake -T
687       option, to specify another toolset.
688
689       For each toolset that comes with this version of Visual  Studio,  there
690       are  variants  that are themselves compiled for 32-bit (x86) and 64-bit
691       (x64) hosts (independent of the architecture they target).  By  default
692       this  generator  uses  the  64-bit  variant on x64 hosts and the 32-bit
693       variant otherwise.  One may explicitly request use of either the 32-bit
694       or  64-bit  host  tools  by  adding  either host=x86 or host=x64 to the
695       toolset specification.  See the  CMAKE_GENERATOR_TOOLSET  variable  for
696       details.
697
698   Other Generators
699   Green Hills MULTI
700       New in version 3.3.
701
702
703       New in version 3.15: Linux support.
704
705
706       Generates    Green    Hills    MULTI   project   files   (experimental,
707       work-in-progress).
708          The buildsystem has predetermined build-configuration settings  that
709          can be controlled via the CMAKE_BUILD_TYPE variable.
710
711   Platform Selection
712       New in version 3.13.
713
714
715       The  variable GHS_PRIMARY_TARGET can be used to select the target plat‐
716       form.
717          Sets primaryTarget entry in project file.
718
719
720       For example:
721
722cmake -G "Green Hills MULTI" -D GHS_PRIMARY_TARGET=ppc_integrity.tgt
723
724       Otherwise the  primaryTarget  will  be  composed  from  the  values  of
725       CMAKE_GENERATOR_PLATFORM  and  GHS_TARGET_PLATFORM.  Defaulting  to the
726       value of arm_integrity.tgt
727
728       • The CMAKE_GENERATOR_PLATFORM variable may be  set,  perhaps  via  the
729         cmake -A option.
730         Typical values of arm, ppc, 86, etcetera, are used.
731
732
733       • The variable GHS_TARGET_PLATFORM may be set, perhaps via the cmake -D
734         option.
735         Defaults to integrity.
736         Usual values are integrity, threadx, uvelosity, velosity,
737         vxworks, standalone.
738
739
740       For example:
741
742cmake -G "Green Hills MULTI" for arm_integrity.tgt.
743
744cmake -G "Green Hills MULTI" -A 86 for 86_integrity.tgt.
745
746cmake -G "Green Hills MULTI"  -D  GHS_TARGET_PLATFORM=standalone  for
747         arm_standalone.tgt.
748
749cmake -G "Green Hills MULTI" -A ppc -D GHS_TARGET_PLATFORM=standalone
750         for ppc_standalone.tgt.
751
752   Toolset Selection
753       New in version 3.13.
754
755
756       The generator searches for the latest compiler or can be given a  loca‐
757       tion to use.  GHS_TOOLSET_ROOT is the directory that is checked for the
758       latest compiler.
759
760       • The CMAKE_GENERATOR_TOOLSET option may be set, perhaps via the  cmake
761         -T option, to specify the location of the toolset.  Both absolute and
762         relative paths are valid. Paths are relative to GHS_TOOLSET_ROOT.
763
764       • The variable GHS_TOOLSET_ROOT may be set, perhaps via  the  cmake  -D
765         option.
766         Root path for toolset searches and relative paths.
767         Defaults to C:/ghs in Windows or /usr/ghs in Linux.
768
769
770       For example, setting a specific compiler:
771
772cmake -G "Green Hills MULTI" -T comp_201754 for /usr/ghs/comp_201754.
773
774cmake     -G     "Green    Hills    MULTI"    -T    comp_201754    -D
775         GHS_TOOLSET_ROOT=/opt/ghs for /opt/ghs/comp_201754.
776
777cmake -G "Green Hills MULTI" -T /usr/ghs/comp_201554
778
779cmake -G "Green Hills MULTI" -T C:/ghs/comp_201754
780
781       For example, searching for latest compiler:
782
783cmake -G "Green Hills MULTI" for searching /usr/ghs.
784
785cmake -G "Green Hills MULTI -D GHS_TOOLSET_ROOT=/opt/ghs" for search‐
786         ing /opt/ghs.
787
788       NOTE:
789          The CMAKE_GENERATOR_TOOLSET should use CMake style paths.
790
791   OS and BSP Selection
792       New in version 3.3.
793
794
795       Certain  target platforms, like Integrity, require an OS.  The RTOS di‐
796       rectory  path  can  be  explicitly  set  using  GHS_OS_DIR.   Otherwise
797       GHS_OS_ROOT will be searched for the latest Integrity RTOS.
798
799       If the target platform, like Integrity, requires a BSP name then it can
800       be set via the GHS_BSP_NAME variable.
801
802GHS_OS_DIR and GHS_OS_DIR_OPTION
803         Sets -os_dir entry in project file.
804
805         GHS_OS_DIR_OPTION default value is -os_dir.
806
807
808         New in version 3.15: The GHS_OS_DIR_OPTION variable.
809
810
811         For example:
812
813cmake -G "Green Hills MULTI" -D GHS_OS_DIR=/usr/ghs/int1144
814
815GHS_OS_ROOT
816         Root path for RTOS searches.
817         Defaults to C:/ghs in Windows or /usr/ghs in Linux.
818
819
820         For example:
821
822cmake -G "Green Hills MULTI" -D GHS_OS_ROOT=/opt/ghs
823
824GHS_BSP_NAME
825         Sets -bsp entry in project file.
826         Defaults to sim<arch> for integrity platforms.
827
828
829         For example:
830
831cmake -G "Green Hills MULTI" for simarm on arm_integrity.tgt.
832
833cmake -G "Green Hills MULTI" -A 86 for sim86 on 86_integrity.tgt.
834
835cmake -G "Green Hills MULTI"  -A  ppc  -D  GHS_BSP_NAME=sim800  for
836           sim800 on ppc_integrity.tgt.
837
838cmake  -G  "Green  Hills  MULTI"  -D  GHS_PRIMARY_TARGET=ppc_integ‐
839           rity.tgt -D  GHS_BSP_NAME=fsl-t1040  for  fsl-t1040  on  ppc_integ‐
840           rity.tgt.
841
842   Target Properties
843       New in version 3.14.
844
845
846       The following properties are available:
847
848GHS_INTEGRITY_APP
849
850GHS_NO_SOURCE_GROUP_FILE
851
852   MULTI Project Variables
853       New in version 3.3.
854
855
856       Adding a Customization file and macros are available through the use of
857       the following variables:
858
859GHS_CUSTOMIZATION - CMake path name to Customization File.
860
861GHS_GPJ_MACROS - CMake list of Macros.
862
863       NOTE:
864          This generator is deemed experimental as  of  CMake  3.25.2  and  is
865          still  a work in progress.  Future versions of CMake may make break‐
866          ing changes as the generator matures.
867
868   Xcode
869       Generate Xcode project files.
870
871       Changed in version 3.15: This generator supports Xcode 5.0 and above.
872
873
874   Toolset and Build System Selection
875       By default Xcode is allowed to select its own default  toolchain.   The
876       CMAKE_GENERATOR_TOOLSET option may be set, perhaps via the cmake -T op‐
877       tion, to specify another toolset.
878
879       New in version 3.19: This generator supports toolset specification  us‐
880       ing one of these forms:
881
882
883toolset
884
885toolset[,key=value]*
886
887key=value[,key=value]*
888
889       The  toolset  specifies the toolset name.  The selected toolset name is
890       provided in the CMAKE_XCODE_PLATFORM_TOOLSET variable.
891
892       The key=value pairs form a comma-separated list of options  to  specify
893       generator-specific  details  of the toolset selection.  Supported pairs
894       are:
895
896       buildsystem=<variant>
897              Specify   the   buildsystem   variant   to   use.     See    the
898              CMAKE_XCODE_BUILD_SYSTEM variable for allowed values.
899
900              For example, to select the original build system under Xcode 12,
901              run cmake(1) with the option -T buildsystem=1.
902
903   Swift Support
904       New in version 3.4.
905
906
907       When using the Xcode generator with Xcode 6.1 or higher, one may enable
908       the Swift language with the enable_language() command or the project().
909
910   Limitations
911       The  Xcode  generator does not support per-configuration sources.  Code
912       like the following will result in a generation error:
913
914          add_executable(MyApp mymain-$<CONFIG>.cpp)
915

EXTRA GENERATORS

917       Some of the CMake Generators listed in the cmake(1)  command-line  tool
918       --help  output may have variants that specify an extra generator for an
919       auxiliary IDE tool.  Such generator names have the form  <extra-genera‐
920       tor>  -  <main-generator>.  The following extra generators are known to
921       CMake.
922
923   CodeBlocks
924       Generates CodeBlocks project files.
925
926       Project files for CodeBlocks will be created in the top  directory  and
927       in every subdirectory which features a CMakeLists.txt file containing a
928       project() call.  Additionally a hierarchy  of  makefiles  is  generated
929       into  the  build  tree.   The  appropriate  make  program can build the
930       project through the default all target.  An install target is also pro‐
931       vided.
932
933       New  in version 3.10: The CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES vari‐
934       able may be set to ON to exclude any files which are located outside of
935       the project root directory.
936
937
938       This "extra" generator may be specified as:
939
940       CodeBlocks - MinGW Makefiles
941              Generate with MinGW Makefiles.
942
943       CodeBlocks - NMake Makefiles
944              Generate with NMake Makefiles.
945
946       CodeBlocks - NMake Makefiles JOM
947              New in version 3.8: Generate with NMake Makefiles JOM.
948
949
950       CodeBlocks - Ninja
951              Generate with Ninja.
952
953       CodeBlocks - Unix Makefiles
954              Generate with Unix Makefiles.
955
956   CodeLite
957       Generates CodeLite project files.
958
959       Project  files for CodeLite will be created in the top directory and in
960       every subdirectory which features a CMakeLists.txt  file  containing  a
961       project()  call.   The  appropriate  make program can build the project
962       through the default all target.  An install target is also provided.
963
964       New in version 3.7: The CMAKE_CODELITE_USE_TARGETS variable may be  set
965       to  ON  to  change the default behavior from projects to targets as the
966       basis for project files.
967
968
969       This "extra" generator may be specified as:
970
971       CodeLite - MinGW Makefiles
972              Generate with MinGW Makefiles.
973
974       CodeLite - NMake Makefiles
975              Generate with NMake Makefiles.
976
977       CodeLite - Ninja
978              Generate with Ninja.
979
980       CodeLite - Unix Makefiles
981              Generate with Unix Makefiles.
982
983   Eclipse CDT4
984       Generates Eclipse CDT 4.0 project files.
985
986       Project files for Eclipse will be created in the top directory.  In out
987       of  source  builds, a linked resource to the top level source directory
988       will be created.  Additionally a hierarchy of  makefiles  is  generated
989       into  the  build  tree.   The  appropriate  make  program can build the
990       project through the default all target.  An install target is also pro‐
991       vided.
992
993       This "extra" generator may be specified as:
994
995       Eclipse CDT4 - MinGW Makefiles
996              Generate with MinGW Makefiles.
997
998       Eclipse CDT4 - NMake Makefiles
999              Generate with NMake Makefiles.
1000
1001       Eclipse CDT4 - Ninja
1002              Generate with Ninja.
1003
1004       Eclipse CDT4 - Unix Makefiles
1005              Generate with Unix Makefiles.
1006
1007   Kate
1008       Generates Kate project files.
1009
1010       A project file for Kate will be created in the top directory in the top
1011       level build directory.  To use it in Kate, the Project plugin  must  be
1012       enabled.   The  project  file is loaded in Kate by opening the Project‐
1013       Name.kateproject file in the editor.  If the Kate Build-plugin  is  en‐
1014       abled, all targets generated by CMake are available for building.
1015
1016       This "extra" generator may be specified as:
1017
1018       Kate - MinGW Makefiles
1019              Generate with MinGW Makefiles.
1020
1021       Kate - NMake Makefiles
1022              Generate with NMake Makefiles.
1023
1024       Kate - Ninja
1025              Generate with Ninja.
1026
1027       Kate - Unix Makefiles
1028              Generate with Unix Makefiles.
1029
1030   Sublime Text 2
1031       Generates Sublime Text 2 project files.
1032
1033       Project  files  for Sublime Text 2 will be created in the top directory
1034       and in every subdirectory which features a CMakeLists.txt file contain‐
1035       ing  a  project()  call.  Additionally Makefiles (or build.ninja files)
1036       are generated into the build tree.  The appropriate  make  program  can
1037       build the project through the default all target.  An install target is
1038       also provided.
1039
1040       This "extra" generator may be specified as:
1041
1042       Sublime Text 2 - MinGW Makefiles
1043              Generate with MinGW Makefiles.
1044
1045       Sublime Text 2 - NMake Makefiles
1046              Generate with NMake Makefiles.
1047
1048       Sublime Text 2 - Ninja
1049              Generate with Ninja.
1050
1051       Sublime Text 2 - Unix Makefiles
1052              Generate with Unix Makefiles.
1053
1055       2000-2023 Kitware, Inc. and Contributors
1056
1057
1058
1059
10603.25.2                           Jan 19, 2023              CMAKE-GENERATORS(7)
Impressum