Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt-apple-cmake-opt-outs.qdoc
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qt-apple-cmake-opt-outs.html
6\title Apple Platform CMake Opt-outs
7\brief Variables and properties that turn off Qt's defaults on Apple platforms.
8
9When \l qt_finalize_target() finalizes an application bundle on macOS, iOS,
10or visionOS, Qt sets several target properties, Info.plist values, and Xcode
11attributes to sensible defaults. Most defaults are skipped when the project
12already provides a value, either through the target property or through the
13matching \c{CMAKE_XCODE_ATTRIBUTE_<name>} variable. The exceptions are:
14
15\list
16\li The bundle name and version defaults check the matching
17 \c{MACOSX_BUNDLE_*} target properties and variables instead.
18\li The bundle identifier default reuses an identifier that the project sets
19 through \c MACOSX_BUNDLE_GUI_IDENTIFIER or
20 \c XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER, and sets both properties.
21\li The localization defaults overwrite an existing
22 \c CFBundleDevelopmentRegion in Info.plist.
23\endlist
24
25Each default can also be turned off with one of the variables described on
26this page.
27
28Set the variables to \c TRUE before the target is finalized, for example on the
29command line or in the project's top-level \c CMakeLists.txt.
30
31\section1 Xcode Attributes
32
33These defaults are only applied when using the Xcode generator.
34
35\table
36\header \li Variable \li Effect when set
37\row \li \c QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID
38 \li Do not set \c XCODE_ATTRIBUTE_DEVELOPMENT_TEAM from the first team
39 found on the system. See \l QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID.
40\row \li \c QT_NO_SET_XCODE_CODE_SIGN_STYLE
41 \li Do not set \c XCODE_ATTRIBUTE_CODE_SIGN_STYLE to \c Automatic.
42\row \li \c QT_NO_SET_XCODE_INSTALL_PATH
43 \li Do not set \c XCODE_ATTRIBUTE_INSTALL_PATH to \c{$(inherited)}.
44\row \li \c QT_NO_SET_XCODE_DEBUG_INFORMATION_FORMAT
45 \li Do not set \c XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT per
46 configuration (\c dwarf for Debug, \c dwarf-with-dsym otherwise).
47 Only a value of the property without a \c{[variant=<config>]}
48 suffix counts as provided by the project.
49\row \li \c QT_NO_SET_XCODE_GCC_GENERATE_DEBUGGING_SYMBOLS
50 \li Do not set \c XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS to
51 \c YES.
52\row \li \c QT_NO_SET_XCODE_COPY_PHASE_STRIP
53 \li Do not set \c XCODE_ATTRIBUTE_COPY_PHASE_STRIP to \c NO. Without the
54 default, Xcode strips embedded frameworks, such as the Qt
55 frameworks, when copying them into the app bundle.
56\row \li \c QT_NO_SET_XCODE_ATTRIBUTE_MARKETING_VERSION and
57 \c QT_NO_SET_XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION
58 \li Do not set the \c XCODE_ATTRIBUTE_MARKETING_VERSION and
59 \c XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION properties. Setting either
60 of the two variables turns off both properties. Info.plist then gets
61 literal version strings instead of Xcode build setting references.
62\endtable
63
64\section1 iOS Attributes
65
66These defaults are applied on iOS only.
67
68\table
69\header \li Variable \li Effect when set
70\row \li \c QT_NO_SET_XCODE_TARGETED_DEVICE_FAMILY
71 \li Do not set \c XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY to iPhone and
72 iPad (\c{1,2}).
73\row \li \c QT_NO_SET_XCODE_ENABLE_BITCODE
74 \li Do not set \c XCODE_ATTRIBUTE_ENABLE_BITCODE to \c NO.
75\row \li \c QT_NO_SET_XCODE_ARCHS
76 \li Do not restrict the iOS simulator to \c x86_64 when Qt was built with
77 that architecture.
78\row \li \c QT_NO_SET_XCODE_LD_ENTRY_POINT
79 \li Do not set \c XCODE_ATTRIBUTE_LD_ENTRY_POINT to Qt's main wrapper.
80\row \li \c QT_NO_SET_DEFAULT_IOS_LAUNCH_SCREEN
81 \li Do not use Qt's default launch screen storyboard when the project
82 provides none. See
83 \l{cmake-variable-QT_IOS_LAUNCH_SCREEN}{QT_IOS_LAUNCH_SCREEN}. The
84 target property of the same name takes precedence over the variable.
85\row \li \c QT_NO_ADD_IOS_LAUNCH_SCREEN_TO_BUNDLE
86 \li Do not add the launch screen storyboard to the app bundle.
87\endtable
88
89\section1 Bundle Metadata
90
91These defaults are applied on all Apple platforms and with all generators.
92
93\table
94\header \li Variable \li Effect when set
95\row \li \c QT_NO_SET_XCODE_BUNDLE_IDENTIFIER
96 \li Do not set the bundle identifier properties. See
97 \l QT_NO_SET_XCODE_BUNDLE_IDENTIFIER.
98\row \li \c QT_NO_SET_XCODE_BUNDLE_NAME
99 \li Do not set \c MACOSX_BUNDLE_BUNDLE_NAME.
100\row \li \c QT_NO_SET_XCODE_BUNDLE_VERSION
101 \li Do not set placeholder values for \c MACOSX_BUNDLE_BUNDLE_VERSION and
102 \c MACOSX_BUNDLE_SHORT_VERSION_STRING.
103\row \li \c QT_NO_SET_PLIST_LOCALIZATIONS
104 \li Do not write \c CFBundleDevelopmentRegion and \c CFBundleLocalizations
105 into Info.plist.
106\endtable
107
108\section1 Shared Library Embedding
109
110The \l{apple-embed-shared-library-dependencies}{embedding of shared libraries}
111into application bundles is controlled by target properties:
112
113\list
114\li \l{cmake-target-property-QT_NO_XCODE_EMBED_FRAMEWORKS}
115 {QT_NO_XCODE_EMBED_FRAMEWORKS} turns it off for an application.
116\li \l{cmake-target-property-QT_NO_XCODE_EMBED_FRAMEWORK_IN_CONSUMERS}
117 {QT_NO_XCODE_EMBED_FRAMEWORK_IN_CONSUMERS} leaves out a single library.
118\endlist
119
120\section1 SDK and Xcode Version Checks
121
122These variables affect the SDK and Xcode version checks that run when
123configuring Qt itself.
124
125\table
126\header \li Variable \li Effect when set
127\row \li \c QT_NO_APPLE_SDK_AND_XCODE_CHECK
128 \li Skip all SDK and Xcode version checks.
129\row \li \c QT_NO_APPLE_SDK_MIN_VERSION_CHECK
130 \li Skip the minimum SDK version check.
131\row \li \c QT_NO_XCODE_MIN_VERSION_CHECK
132 \li Skip the minimum Xcode version check, and do not require Xcode to be
133 installed.
134\row \li \c QT_NO_APPLE_SDK_MAX_VERSION_CHECK
135 \li Do not warn when the SDK is newer than the newest tested version.
136\row \li \c QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK
137 \li Turn the error for an unsupported SDK or Xcode version into a
138 warning.
139\endtable
140
141\sa qt_finalize_target()
142*/