[poppler] Branch 'qt5' - cmake/modules

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jun 17 15:34:01 PDT 2013


 cmake/modules/FindQt4.cmake |   62 +++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 23 deletions(-)

New commits:
commit 93a1c2b768cc419c5bf9b3033bf85fb21326a65a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jun 18 00:33:38 2013 +0200

    If qmake gives us a Qt5 qmake try with qmake4 and qmake-qt4

diff --git a/cmake/modules/FindQt4.cmake b/cmake/modules/FindQt4.cmake
index 9122bb3..79378b0 100644
--- a/cmake/modules/FindQt4.cmake
+++ b/cmake/modules/FindQt4.cmake
@@ -250,19 +250,7 @@ MACRO(QT_QUERY_QMAKE outvar invar)
 
 ENDMACRO(QT_QUERY_QMAKE)
 
-GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
-# check for qmake
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS
-  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
-  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
-  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
-  $ENV{QTDIR}/bin
-)
-
-IF (QT_QMAKE_EXECUTABLE)
-
-  SET(QT4_QMAKE_FOUND FALSE)
-  
+MACRO(VERIFY_QMAKE_QT4)
   EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
 
   # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
@@ -307,19 +295,47 @@ IF (QT_QMAKE_EXECUTABLE)
     STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_qt_major_vers "${QTVERSION}")
     STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" found_qt_minor_vers "${QTVERSION}")
     STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_qt_patch_vers "${QTVERSION}")
+    IF (${found_qt_major_vers} EQUAL 4)
+      # compute an overall version number which can be compared at once
+      MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
+      MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
+
+
+      IF (found_vers LESS req_vers)
+        SET(QT4_QMAKE_FOUND FALSE)
+        SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
+      ELSE (found_vers LESS req_vers)
+        SET(QT4_QMAKE_FOUND TRUE)
+      ENDIF (found_vers LESS req_vers)
+    ENDIF ()
+  ENDIF (qt_version_tmp)
+ENDMACRO()
 
-    # compute an overall version number which can be compared at once
-    MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
-    MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
+GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
+# check for qmake
+FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS
+  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
+  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
+  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
+  $ENV{QTDIR}/bin
+)
 
-    IF (found_vers LESS req_vers)
-      SET(QT4_QMAKE_FOUND FALSE)
-      SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
-    ELSE (found_vers LESS req_vers)
-      SET(QT4_QMAKE_FOUND TRUE)
-    ENDIF (found_vers LESS req_vers)
-  ENDIF (qt_version_tmp)
+IF (QT_QMAKE_EXECUTABLE)
 
+  SET(QT4_QMAKE_FOUND FALSE)
+  VERIFY_QMAKE_QT4()
+
+  IF (NOT QT4_QMAKE_FOUND)
+    FIND_PROGRAM(QT_QMAKE_EXECUTABLE2 NAMES qmake4 qmake-qt4 PATHS
+      "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
+      "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
+      "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
+      $ENV{QTDIR}/bin
+    )
+    SET(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE2})
+    VERIFY_QMAKE_QT4()
+  ENDIF()
+  
 ENDIF (QT_QMAKE_EXECUTABLE)
 
 IF (QT4_QMAKE_FOUND)


More information about the poppler mailing list