summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-05-03 14:46:50 (GMT)
committerStephen Kelly <steveire@gmail.com>2012-05-03 14:47:07 (GMT)
commit1dfe15c4314c2b7ef6cb15a5deb274f73c3de3ce (patch)
treede4d912a735e31124c7c57c9b169f78be55279ce /Modules/FindQt4.cmake
parent3817314e2a7d83b70a8d0ced189781f676db844c (diff)
downloadCMake-1dfe15c4314c2b7ef6cb15a5deb274f73c3de3ce.zip
CMake-1dfe15c4314c2b7ef6cb15a5deb274f73c3de3ce.tar.gz
CMake-1dfe15c4314c2b7ef6cb15a5deb274f73c3de3ce.tar.bz2
Abort FindQt4.cmake if Qt 5 is found.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake20
1 files changed, 16 insertions, 4 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 9b646b4..e7cd02f 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1169,10 +1169,22 @@ ELSE( Qt4_FIND_COMPONENTS )
ENDIF( Qt4_FIND_COMPONENTS )
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4
- REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS}
- VERSION_VAR QTVERSION
- )
+if (${QT_VERSION_MAJOR} GREATER 4)
+ SET(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}")
+ SET(QT4_FOUND FALSE)
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x")
+ ELSE(Qt4_FIND_REQUIRED)
+ IF(NOT Qt4_FIND_QUIETLY)
+ MESSAGE( STATUS "${VERSION_MSG}")
+ ENDIF(NOT Qt4_FIND_QUIETLY)
+ ENDIF(Qt4_FIND_REQUIRED)
+else()
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4
+ REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS}
+ VERSION_VAR QTVERSION
+ )
+endif()
#######################################
#