Skip to content

Commit

Permalink
build(cmake): build against Qt 6 by default
Browse files Browse the repository at this point in the history
Add ZEAL_USE_QT5 option to force build against Qt 5.

Fixes #1647.
  • Loading branch information
trollixx committed Aug 4, 2024
1 parent 4260a45 commit 04c525b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ set(PROJECT_COMPANY_NAME "Oleg Shparber")
set(PROJECT_COPYRIGHT "© 2013-2024 Oleg Shparber and other contributors")

# Find available major Qt version. It will be stored in QT_VERSION_MAJOR.
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
if(QT_VERSION_MAJOR EQUAL 6)
if(NOT ZEAL_USE_QT5)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)

Check failure on line 26 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Ubuntu 20.04 / Qt 5

Could not find a package configuration file provided by "QT" with any of

Check failure on line 26 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / Ubuntu 20.04 / Qt 5 / Portable

Could not find a package configuration file provided by "QT" with any of
set(QT_MINIMUM_VERSION 6.2.0)
else()
endif()

if(NOT QT_FOUND)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core)
set(QT_MINIMUM_VERSION 5.9.5)
endif()

message(NOTICE "Detected Qt version: ${QT_VERSION}")

# Determine version for dev builds.
if(NOT ZEAL_RELEASE_BUILD)
message(NOTICE "Building unreleased code. Proceed at your own risk!")
Expand Down

0 comments on commit 04c525b

Please sign in to comment.