Fix separately building SQL plugins with CMake 3.16

Also move the cmake_minimum_required call to the top of the file,
because the line before already requires some policy settings, which is
what cmake_minimum_required() is establishing.

For the standard Qt build, we make sure to get appropriate policy
settings by calling qt_internal_upgrade_cmake_policies().

Pick-to: 6.0
Change-Id: If97556a9dd00646e83957959d0f9f16916625160
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Joerg Bornemann 2021-01-13 17:21:56 +01:00
parent 722a7dda56
commit d95a1a8bd4

View File

@ -1,8 +1,8 @@
# Generated from sqldrivers.pro.
# special case begin
cmake_minimum_required(VERSION 3.16)
if (NOT CMAKE_PROJECT_NAME STREQUAL "QtBase" AND NOT CMAKE_PROJECT_NAME STREQUAL "Qt")
cmake_minimum_required(VERSION 3.17)
include(.cmake.conf)
project(QSQLiteDriverPlugins
VERSION "${QT_REPO_MODULE_VERSION}"
@ -19,6 +19,8 @@ if (NOT CMAKE_PROJECT_NAME STREQUAL "QtBase" AND NOT CMAKE_PROJECT_NAME STREQUAL
# needed by qt_internal_add_plugin
add_custom_target(qt_plugins)
else()
qt_internal_upgrade_cmake_policies()
endif()
# Currently handled completely manually.