From c6595563afb5955e13ea3c9f26bc280146a944d1 Mon Sep 17 00:00:00 2001 From: Murmele Date: Sun, 16 Apr 2023 11:32:45 +0200 Subject: [PATCH] if QT_VERSION_MAJOR is defined, use this version instead of searching again. Labplot does not support Qt6 yet and therefore the version is set manually in the project. If Qt5 and Qt6 are installed, QAd overwrites the Qt5 requirement and then the configuration of the project does not work (#504) --- src/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2ec56aa..8224644 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,11 @@ cmake_minimum_required(VERSION 3.5) project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT}) -find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) +if (${QT_VERSION_MAJOR}) + message(STATUS "Forced to use Qt version ${QT_VERSION_MAJOR}") + find_package(QT NAMES Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +else() + find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) +endif() find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED) if (UNIX AND NOT APPLE) include_directories(${Qt${QT_VERSION_MAJOR}Gui_PRIVATE_INCLUDE_DIRS})