Last active
February 19, 2024 22:49
-
-
Save SC-One/01f41767e5f0514e293fbbda0ef7446b to your computer and use it in GitHub Desktop.
CMake code for checking qt major minor patch version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First way todays: | |
find_package(QT 5.15.2 NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick LinguistTools) | |
############################################################################################ | |
# Alternative way: | |
if (Qt5Core_FOUND) | |
if (Qt5Core_VERSION VERSION_LESS 5.15.2) | |
message(FATAL_ERROR "Minimum supported Qt5 version is 5.15.2! current version: " ${Qt5Core_VERSION}) | |
endif() | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment