diff options
author | Tor Arne Vestbø <torarnv@gmail.com> | 2020-03-11 21:45:50 +0100 |
---|---|---|
committer | Tor Arne Vestbø <torarnv@gmail.com> | 2020-03-13 15:23:56 +0100 |
commit | 3a2fa3fec5a43d30f1a93a8e89e2973f23ee4ef3 (patch) | |
tree | 42f05d5f4c0a095c7113e3f55a62544e44811444 /CMakeLists.txt | |
parent | 951d49075066cf8f66906c803c32cc2c52fd8e18 (diff) |
cmake: Add default Info.plist for macOS with some important keys
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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7027597bd8..62f12110d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,11 @@ if(NOT QT_BUILD_STANDALONE_TESTS) "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin" ) + if(APPLE_OSX) + # Add module directory to pick up custom Info.plist template + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos") + endif() + ## Find the build internals package. set(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION TRUE) list(PREPEND CMAKE_PREFIX_PATH |