Skip to content

Commit

Permalink
chore: add qt option in cmakelists
Browse files Browse the repository at this point in the history
add option OPT_ENABLE_QT6

Log: add new option in cmakelists
  • Loading branch information
Lighto-Ku authored and Johnson-zs committed Jul 11, 2024
1 parent fd2026f commit 6000a1d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ SET(CMAKE_AUTOMOC ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
#SET(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
set(QT_MINIMUM_VERSION "5.6.3")

option(OPT_ENABLE_QT6 "Use Qt6" OFF)

include(GNUInstallDirs)
find_package(QT NAMES Qt6 Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Core)

if(OPT_ENABLE_QT6)
find_package(QT NAMES Qt6 CONFIG REQUIRED Core)
else()
set(QT_MINIMUM_VERSION "5.6.3")
find_package(QT NAMES Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Core)
endif()

find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
message("Using Qt version: ${QT_VERSION}")

Expand Down

0 comments on commit 6000a1d

Please sign in to comment.