Skip to content

Instantly share code, notes, and snippets.

@SC-One
Last active February 19, 2024 22:49
Show Gist options
  • Save SC-One/01f41767e5f0514e293fbbda0ef7446b to your computer and use it in GitHub Desktop.
Save SC-One/01f41767e5f0514e293fbbda0ef7446b to your computer and use it in GitHub Desktop.
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