cmake/Help/generator/Xcode.rst

57 lines
1.6 KiB
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
Xcode
-----
Generate Xcode project files.
2017-04-14 19:02:05 +02:00
2021-09-14 00:13:48 +02:00
.. versionchanged:: 3.15
This generator supports Xcode 5.0 and above.
2017-07-20 19:35:53 +02:00
2021-09-14 00:13:48 +02:00
.. _`Xcode Build System Selection`:
Toolset and Build System Selection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2017-04-14 19:02:05 +02:00
By default Xcode is allowed to select its own default toolchain.
The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
2022-11-16 20:14:03 +01:00
via the :option:`cmake -T` option, to specify another toolset.
2021-09-14 00:13:48 +02:00
.. versionadded:: 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 :variable:`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 :variable:`CMAKE_XCODE_BUILD_SYSTEM` variable for allowed values.
For example, to select the original build system under Xcode 12,
2022-11-16 20:14:03 +01:00
run :manual:`cmake(1)` with the option :option:`-T buildsystem=1 <cmake -T>`.
2021-09-14 00:13:48 +02:00
Swift Support
^^^^^^^^^^^^^
.. versionadded:: 3.4
2023-05-23 16:38:00 +02:00
When using the ``Xcode`` generator with Xcode 6.1 or higher,
2021-09-14 00:13:48 +02:00
one may enable the ``Swift`` language with the :command:`enable_language`
command or the :command:`project`.
2022-11-16 20:14:03 +01:00
Limitations
^^^^^^^^^^^
The Xcode generator does not support per-configuration sources.
Code like the following will result in a generation error:
.. code-block:: cmake
add_executable(MyApp mymain-$<CONFIG>.cpp)