qtbase/cmake/QtConfigExtras.cmake.in
Alexandru Croitor d84133fac8 CMake: Warn when configuring Qt with an unsupported Apple SDK or Xcode
The warnings are shown when configuring any Qt submodule or top-level.
The warnings are NOT shown when configuring a user project with CMake.

Opt out CMake cache variables can be set to silence any of the
warnings:
- QT_NO_APPLE_SDK_AND_XCODE_CHECK
- QT_NO_APPLE_SDK_MIN_VERSION_CHECK
- QT_NO_XCODE_MIN_VERSION_CHECK
- QT_NO_APPLE_SDK_MAX_VERSION_CHECK

The warnings can be upgraded into errors by configuring with
-DQT_FORCE_FATAL_APPLE_SDK_AND_XCODE_CHECK=ON

The platform version requirements that qtbase specifies in .cmake.conf
are saved in Qt6ConfigExtras.cmake so that they can be used when
configuring other non-qtbase submodules.

The code is added to the public CMake files, so that in the future we
don't need to move code around if we enable the checks for public
CMake projects as well.

The version extraction helpers were moved out of QtAutoDetectHelpers
into QtPublicAppleHelpers.

Task-number: QTBUG-119490
Change-Id: Ic840e1013aeb607bf23247a9cb43471dde802e9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit a29bff3d80219f54d0837b0e6e0577192011dea1)
2023-11-30 10:18:33 +01:00

5 lines
199 B
CMake

set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT "@supported_min_version_for_using_qt@")
set(QT_COMPUTED_MIN_CMAKE_VERSION_FOR_USING_QT "@computed_min_version_for_using_qt@")
@QT_CONFIG_EXTRAS_CODE@