4 Generate Xcode project files.
6 .. versionchanged:: 3.15
7 This generator supports Xcode 5.0 and above.
9 .. _`Xcode Build System Selection`:
11 Toolset and Build System Selection
12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 By default Xcode is allowed to select its own default toolchain.
15 The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
16 via the :option:`cmake -T` option, to specify another toolset.
18 .. versionadded:: 3.19
19 This generator supports toolset specification using one of these forms:
22 * ``toolset[,key=value]*``
23 * ``key=value[,key=value]*``
25 The ``toolset`` specifies the toolset name. The selected toolset name
26 is provided in the :variable:`CMAKE_XCODE_PLATFORM_TOOLSET` variable.
28 The ``key=value`` pairs form a comma-separated list of options to
29 specify generator-specific details of the toolset selection.
32 ``buildsystem=<variant>``
33 Specify the buildsystem variant to use.
34 See the :variable:`CMAKE_XCODE_BUILD_SYSTEM` variable for allowed values.
36 For example, to select the original build system under Xcode 12,
37 run :manual:`cmake(1)` with the option :option:`-T buildsystem=1 <cmake -T>`.
44 When using the :generator:`Xcode` generator with Xcode 6.1 or higher,
45 one may enable the ``Swift`` language with the :command:`enable_language`
46 command or the :command:`project`.
51 The Xcode generator does not support per-configuration sources.
52 Code like the following will result in a generation error:
56 add_executable(MyApp mymain-$<CONFIG>.cpp)