From: Manuel Nickschas Date: Mon, 31 Mar 2014 22:07:45 +0000 (+0200) Subject: Make sure our Qt5 is new enough X-Git-Tag: 0.11.0~39 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=4c3537d99a026745f9c69a2bb375abb1067b80c8;hp=7f8c7852c2ee6b529fbc6c5fa38b49b53b15af1a Make sure our Qt5 is new enough find_package will happily ignore the requested version if not used with REQUIRED, plus early Qt5 versions handled versions differently; thus, let's explicitly check for a supported version and bail out otherwise. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b57061af..d6b0d2e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,12 +145,18 @@ endif() # using -DCMAKE_DISABLE_FIND_PACKAGE_=TRUE ##################################################################### -if(USE_QT5) +if (USE_QT5) find_package(Qt5Core ${QT_MIN_VERSION} QUIET) set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED URL "http://qt.digia.com" DESCRIPTION "contains core functionality for Qt" ) + # find_package without REQUIRED won't check for the version properly; also, older Qt5 versions + # used Qt5Core_VERSION_STRING... let's just make sure here that we bail out here if our Qt5 is not new enough. + if (NOT Qt5Core_VERSION OR Qt5Core_VERSION VERSION_LESS ${QT_MIN_VERSION}) + message(FATAL_ERROR "Could NOT find Qt5 >= version ${QT_MIN_VERSION}!") + endif() + find_package(Qt5Network QUIET) set_package_properties(Qt5Network PROPERTIES TYPE REQUIRED DESCRIPTION "the network module for Qt5" @@ -187,7 +193,7 @@ if(USE_QT5) DESCRIPTION "a multimedia abstraction library" PURPOSE "Required for audio notifications" ) - + find_package(LibsnoreQt5 QUIET) set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL URL "https://github.com/TheOneRing/Snorenotify"