blob: 47a1a37e1ba3f61be2b8901fda02ff01c6702b2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a7d805..65bd4db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,11 @@ set(CMAKE_AUTORCC ON)
add_executable(gpsbabel)
# Find the QtCore library
-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
+if(USE_QT6)
+ find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED)
+else()
+ find_package(QT NAMES Qt5 COMPONENTS Core REQUIRED)
+endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core)
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12)
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 4c839c2..ac329dd 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -23,7 +23,11 @@ endif()
add_executable(${TARGET} WIN32 MACOSX_BUNDLE)
# Find the QtCore library
-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
+if(USE_QT6)
+ find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED)
+else()
+ find_package(QT NAMES Qt5 COMPONENTS Core REQUIRED)
+endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED)
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)
if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12)
|