diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-19 14:49:52 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-22 13:01:35 +0200 |
commit | de6e92e26a49de4942f006c2e70f11d1dbf600d6 (patch) | |
tree | ff2c3d37d91c3275c8d0e122946b7e1bca9a55b5 /src/corelib/corelib.pro | |
parent | 5062dd417512d21c77fb07448dbbe9ecd0ee0dcb (diff) |
CMake: Provide the minimum darwin deployment target needed by Qt
This is useful information for people that want to use Qt in their
project with CMake.
Unfortunately there is no good way to actually set
CMAKE_OSX_DEPLOYMENT_TARGET automatically with the Qt provided value,
because it needs to be set before the first project() call in a
CMake project.
This means it can be set either on the command line, or manually by the
application developer in CMakeLists.txt before the first project()
call or via a CMake toolchain.
In Qt 6 we provide a CMake toolchain file with the deployment target
already set, so if the application developer uses the Qt generated
toolchain, they will get the value automatically.
In Qt 5 the value can only be read for informational purposes only,
from the QT_DARWIN_MIN_DEPLOYMENT_TARGET property on the
Qt5::Core target. The same property is set in Qt 6 for compatibility
resons.
Task-number: QTBUG-76167
Task-number: QTCREATORBUG-22466
Change-Id: Id61d70dc9a1b7a0e7cdb90b1e679171ea178126b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit 10f8ebe3e2075a02d910f2d02cc0e81abe727c2f)
Diffstat (limited to 'src/corelib/corelib.pro')
-rw-r--r-- | src/corelib/corelib.pro | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 3430154d13..7d057e010d 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -117,6 +117,12 @@ defineTest(pathIsAbsolute) { ##### This requires fixing, so that the feature system works with cmake as well CMAKE_DISABLED_FEATURES = $$join(QT_DISABLED_FEATURES, "$$escape_expand(\\n) ") +# Embed the minimum darwin deployment target that Qt needs for informational purposes only. +macos: CMAKE_MIN_DARWIN_DEPLOYMENT_TARGET = $$QMAKE_MACOSX_DEPLOYMENT_TARGET +ios: CMAKE_MIN_DARWIN_DEPLOYMENT_TARGET = $$QMAKE_IOS_DEPLOYMENT_TARGET +tvos: CMAKE_MIN_DARWIN_DEPLOYMENT_TARGET = $$QMAKE_TVOS_DEPLOYMENT_TARGET +watchos: CMAKE_MIN_DARWIN_DEPLOYMENT_TARGET = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET + CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA/src], $$[QT_INSTALL_PREFIX]) pathIsAbsolute($$CMAKE_HOST_DATA_DIR) { CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA/src]/ |