File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,16 @@ set(CMAKE_CXX_STANDARD 11)
1111set (CMAKE_CXX_STANDARD_REQUIRED ON )
1212
1313# Find Qt
14- find_package (Qt6 COMPONENTS Core Gui Network SerialPort Widgets REQUIRED)
15- find_package (Qt5 COMPONENTS Core Gui Network SerialPort Widgets)
16-
17- if (Qt6_FOUND)
18- set (QT_VERSION 6)
19- message (STATUS "Using Qt 6" )
14+ if (QT_VERSION EQUAL 6)
15+ find_package (Qt6 COMPONENTS Core Gui Network SerialPort Widgets)
2016 set (QT_LIBS Qt6::Core Qt6::Gui Qt6::Network Qt6::SerialPort Qt6::Widgets)
21- else ( )
22- set (QT_VERSION 5)
23- message ( STATUS "Using Qt 5" )
17+ message ( STATUS "Using Qt 6" )
18+ elseif (QT_VERSION EQUAL 5)
19+ find_package (Qt5 COMPONENTS Core Gui Network SerialPort Widgets )
2420 set (QT_LIBS Qt5::Core Qt5::Gui Qt5::Network Qt5::SerialPort Qt5::Widgets)
21+ message (STATUS "Using Qt 5" )
22+ else ()
23+ message (FATAL_ERROR "QT_VERSION not specified or invalid. Use -DQT_VERSION=5 or -DQT_VERSION=6" )
2524endif ()
2625
2726# Add source files
You can’t perform that action at this time.
0 commit comments