Skip to content

Instantly share code, notes, and snippets.

@SC-One
Last active February 19, 2024 22:49
CMake code for checking qt major minor patch version
# 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