From 87f0b15c466ad139fb57dfc724240961a0f0cb2e Mon Sep 17 00:00:00 2001 From: silverqx Date: Fri, 3 May 2024 17:17:41 +0200 Subject: [PATCH] cmake throw fatal error if BUILD_DRIVERS and Qt <6 --- drivers/common/CMakeLists.txt | 3 +++ drivers/mysql/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/common/CMakeLists.txt b/drivers/common/CMakeLists.txt index 362fca90f..82bcaaf35 100644 --- a/drivers/common/CMakeLists.txt +++ b/drivers/common/CMakeLists.txt @@ -194,6 +194,9 @@ tiny_resource_and_manifest(${TinyDrivers_target} # 'WINVER' macro redefined [-Wmacro-redefined] # Look also to the TinyCommon for conditional WINVER definition find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +if(QT_VERSION_MAJOR LESS 6) + message(FATAL_ERROR "TinyDrivers library is not supported with Qt version <6.") +endif() # No need to call the tiny_find_package() here as the core TinyOrm always depends on it find_package(Qt${QT_VERSION_MAJOR} ${minQtVersion} CONFIG REQUIRED COMPONENTS Core diff --git a/drivers/mysql/CMakeLists.txt b/drivers/mysql/CMakeLists.txt index faa69d7f7..140de5f88 100644 --- a/drivers/mysql/CMakeLists.txt +++ b/drivers/mysql/CMakeLists.txt @@ -148,6 +148,9 @@ tiny_resource_and_manifest(${TinyMySql_target} # 'WINVER' macro redefined [-Wmacro-redefined] # Look also to the TinyCommon for conditional WINVER definition find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +if(QT_VERSION_MAJOR LESS 6) + message(FATAL_ERROR "TinyMySql library is not supported with Qt version <6.") +endif() # No need to call the tiny_find_package() here as the core TinyOrm always depends on it find_package(Qt${QT_VERSION_MAJOR} ${minQtVersion} CONFIG REQUIRED COMPONENTS Core