summaryrefslogtreecommitdiffstats
path: root/cmake/macos
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Generate Apple privacy manifest files for Qt modulesTor Arne Vestbø2024-02-131-0/+12
| | | | | | | | | | | | | | | | | | | The default manifest is a minimal file that claims NSPrivacyTracking false, along with an empty list of NSPrivacyTrackingDomains and NSPrivacyCollectedDataTypes, as Qt does not generally do user tracking. Modules can override the default manifest by setting the PRIVACY_MANIFEST target property, specifying a custom privacy manifest. The NSPrivacyAccessedAPITypes key is only required for iOS for now. Even though we don't build Qt for iOS as frameworks yet, which is required to embed a privacy manifest, we include the keys for the APIs we known we use. Task-number: QTBUG-114319 Change-Id: I654bb52b98ee963adeeb744b35f3a1c2a1270969 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Copy template Info.plist for macOS manually, like we do for iOSTor Arne Vestbø2023-06-011-0/+0
| | | | | | | | | Unifies the approach between iOS and macOS. By copying the Info.plist to the build directory, we also open up the possibility to modify it, which we can't do when CMake does the copy during its generator step. Change-Id: I59f9f69ac368166bb26d8a5c57bf4ea3f503d51b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Apple: Add CFBundleAllowMixedLocalizations=YES to Info.plist filesTor Arne Vestbø2022-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently don't have any machinery for qmake or CMake to map translations declared via TRANSLATIONS += or qt_add_translations to the Info.plist CFBundleLocalizations key. This results in macOS and iOS falling back to the development region, CFBundleDevelopmentRegion, as the only supported localization of the app, which is in most cases set to 'en'. Unfortunately this doesn't work well with the behavior of iOS 11+ and macOS 10.13+ where the OS will set the locale of the app to the best match between the app's supported localizations and the user's preferred language. https://developer.apple.com/library/archive/qa/qa1828/ Since we only support a single localization, the development region, the locale always ends up as 'en_<REGION>', which after QTBUG-104930 is also reflected in the QLocale's uiLanguages(), resulting in the QTranslator machinery always picking English translation for the app. As long as we don't explicitly declare CFBundleLocalizations we need to opt out of the system's behavior of finding the best match between the app's declared localizations and the user's preferences, which we can do via the CFBundleAllowMixedLocalizations key. Fixes: QTBUG-63324 Pick-to: 6.4 Change-Id: If7586d342148cbbb1d2a152cef039aad4448b13c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Apple: Use 'en' instead of 'English' as development regionTor Arne Vestbø2022-10-231-1/+1
| | | | | | | | | | | This is consistent with what $(DEVELOPMENT_LANGUAGE) reports, as well as the Apple Locales Programming Guide which states that "Locale names such as “English”, “French”, and “Japanese” are deprecated in OS X and are supported solely for backward compatibility." Pick-to: 6.4 Change-Id: I99779d678ef9d4ea90249572f2f977e9b4df6c62 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove CFBundleGetInfoString from CMake Info.plist templatesTor Arne Vestbø2021-11-011-2/+0
| | | | | | | | | | | It's been deprecated since Mac OS X 10.5. qmake templates fixed in 0768a28fbfe4c7227182b6b4b7cacbc6772c54f4. Task-number: QTBUG-74872 Pick-to: 6.2 Change-Id: If7d988f27f07b6fa095b2ea51a87c306361d63d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Remove deprecated CFBundleLongVersionString from Info.plistAlexandru Croitor2021-08-171-2/+0
| | | | | | | | | | | | The CFBundleLongVersionString Info.plist entry has been deprecated and removed from Apple documentation for a long time now. Remove it. Pick-to: 6.2 Task-number: QTBUG-95838 Change-Id: I4e4f74e00d678fd67875976c8884a80cdbb8cec4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* cmake: Add default Info.plist for macOS with some important keysTor Arne Vestbø2020-03-131-0/+44
The default Info.plist shipped with CMake lacks an NSPrincipalClass entry, which is crucial for making macOS apps run in full resolution on retina screens. We make sure the file is only picked up on macOS, not iOS and friends, since those platforms require another principal class. If needed we can extract the value out as a CMake variable and use the same file for all Apple platforms. Doing so would assume all keys are single-platform only, so if that's not the case we need platform-specific files. We should probably extract the package type out as a variable too, so that the file can be used for both apps, plugins, and frameworks, but doing so requires setting up that variable somewhere based on the target type, which CMake doesn't allow in an easy way. The file itself is based on the file CMake ships, combined with keys inherited from Qt's existing plist templates for qmake, and adjusted to match what Xcode generates by default these days. Change-Id: I3f5109e5fff63cdbd109a99d4008948d4bd2102b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>