diff options
author | Brandon Hong <brandon.hong@intel.com> | 2019-09-20 13:19:27 +0800 |
---|---|---|
committer | Brandon Hong <brandon.hong@intel.com> | 2019-09-20 13:19:27 +0800 |
commit | 102b1f02cd9854639fb57d689a477cda6180aaf5 (patch) | |
tree | c832ccb74f6741bef3053e22d7d2ee4b3a86254c /cmake | |
parent | 4a7951b480b9e777c550d11b6c36424bd4009c5c (diff) |
Fix wrong version number matching
As the CMake MATCH takes regex parameter, sub-string could unexpectedtly
be matched. QT verseion 5.12.4, for instance, will be matched with not just
for QT5 but also for QT4 as well due to the sub-string '4' which is unexpected.
This patch resolves the issue by constraining version number testing for
Major version numbers only.
Signed-off-by: Brandon Hong <brandon.hong@intel.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindQt.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/modules/FindQt.cmake b/cmake/modules/FindQt.cmake index 574aef29..f1f5245f 100644 --- a/cmake/modules/FindQt.cmake +++ b/cmake/modules/FindQt.cmake @@ -26,10 +26,10 @@ IF(NOT QT5_INSTALLED) # now find qmake IF(QT_QMAKE_EXECUTABLE) EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION) - IF(QTVERSION MATCHES "4.*") + IF(QTVERSION MATCHES "^4.*") SET(QT4_INSTALLED TRUE) ENDIF() - IF(QTVERSION MATCHES "5.*") + IF(QTVERSION MATCHES "^5.*") SET(QT5_INSTALLED TRUE) ENDIF() ENDIF() |