Skip to content

Commit c659556

Browse files
authored
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)
1 parent cb24317 commit c659556

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT})
3-
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
3+
if (${QT_VERSION_MAJOR})
4+
message(STATUS "Forced to use Qt version ${QT_VERSION_MAJOR}")
5+
find_package(QT NAMES Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
6+
else()
7+
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
8+
endif()
49
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED)
510
if (UNIX AND NOT APPLE)
611
include_directories(${Qt${QT_VERSION_MAJOR}Gui_PRIVATE_INCLUDE_DIRS})

0 commit comments

Comments
 (0)