[cmake-developers] OpenBSD patches: final patch for Qt3/Qt4 related stuff

Amit Kulkarni amitkulz at gmail.com
Wed Dec 5 12:36:14 EST 2012


Commit message: Handle OpenBSD specific paths in Qt3/Qt4, allowing concurrent building and installation. Some common programs are renamed with suffixes of either 3 or 4. Also, allow qt3/qt4 installed under /usr/local to be searched and recognized appropriately.

diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 541cc05..54b7c6f 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -43,6 +43,12 @@ if(GLOB_TEMP_VAR)
 endif()
 set(GLOB_TEMP_VAR)
 
+file(GLOB GLOB_TEMP_VAR /usr/local/lib/qt3/bin/qmake)
+if(GLOB_TEMP_VAR)
+  set(QT3_INSTALLED TRUE)
+endif()
+set(GLOB_TEMP_VAR)
+
 # look for qt4 installations
 file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake)
 if(GLOB_TEMP_VAR)
@@ -56,6 +62,12 @@ if(GLOB_TEMP_VAR)
 endif()
 set(GLOB_TEMP_VAR)
 
+file(GLOB GLOB_TEMP_VAR /usr/local/lib/qt4/bin/qmake)
+if(GLOB_TEMP_VAR)
+  set(QT4_INSTALLED TRUE)
+endif()
+set(GLOB_TEMP_VAR)
+
 if (Qt_FIND_VERSION)
   set(DESIRED_QT_VERSION "${Qt_FIND_VERSION}")
 endif ()
@@ -91,6 +103,7 @@ find_file( QT4_QGLOBAL_H_FILE qglobal.h
   /usr/lib/qt/include/Qt
   /usr/include/Qt
   /usr/share/qt4/include/Qt
+  /usr/local/include/X11/qt4/Qt
   C:/Progra~1/qt/include/Qt )
 
 if(QT4_QGLOBAL_H_FILE)
@@ -110,6 +123,7 @@ find_file( QT3_QGLOBAL_H_FILE qglobal.h
   /usr/lib/qt/include
   /usr/include
   /usr/share/qt3/include
+  /usr/local/include/X11/qt3
   C:/Progra~1/qt/include
   /usr/include/qt3 )
 
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 07b6fef..6034afb 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -64,6 +64,7 @@ find_path(QT_INCLUDE_DIR qt.h
   /usr/share/qt3/include
   C:/Progra~1/qt/include
   /usr/include/qt3
+  /usr/local/include/X11/qt3
   )
 
 # if qglobal.h is not in the qt_include_dir then set
@@ -96,6 +97,7 @@ if (QT_MT_REQUIRED)
       "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
       ENV QTDIR
       ${GLOB_PATHS_LIB}
+      /usr/local
       /usr/local/qt
       /usr/lib/qt
       /usr/lib/qt3
@@ -117,6 +119,7 @@ else ()
       "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
       ENV QTDIR
       ${GLOB_PATHS_LIB}
+      /usr/local
       /usr/local/qt
       /usr/lib/qt
       /usr/lib/qt3
@@ -136,6 +139,7 @@ find_library(QT_QASSISTANTCLIENT_LIBRARY
     "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
     ENV QTDIR
     ${GLOB_PATHS_LIB}
+    /usr/local
     /usr/local/qt
     /usr/lib/qt3
     /usr/share/qt3
@@ -146,7 +150,7 @@ find_library(QT_QASSISTANTCLIENT_LIBRARY
 
 # Qt 3 should prefer QTDIR over the PATH
 find_program(QT_MOC_EXECUTABLE
-  NAMES moc-qt3 moc
+  NAMES moc-qt3 moc moc3 moc3-mt
   HINTS
     ENV QTDIR
   PATHS
@@ -154,6 +158,7 @@ find_program(QT_MOC_EXECUTABLE
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
   ${GLOB_PATHS_BIN}
+    /usr/local/lib/qt3
     /usr/local/qt
     /usr/lib/qt
     /usr/lib/qt3
@@ -170,7 +175,7 @@ endif()
 
 # Qt 3 should prefer QTDIR over the PATH
 find_program(QT_UIC_EXECUTABLE
-  NAMES uic-qt3 uic
+  NAMES uic-qt3 uic uic3 uic3-mt
   HINTS
     ENV QTDIR
   PATHS
@@ -178,6 +183,7 @@ find_program(QT_UIC_EXECUTABLE
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
   ${GLOB_PATHS_BIN}
+    /usr/local
     /usr/local/qt
     /usr/lib/qt
     /usr/lib/qt3
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 00e86e8..ea4d8f4 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -986,13 +986,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
   endif()
 
   find_program(QT_MOC_EXECUTABLE
-    NAMES moc-qt4 moc
+    NAMES moc-qt4 moc moc4
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
   find_program(QT_UIC_EXECUTABLE
-    NAMES uic-qt4 uic
+    NAMES uic-qt4 uic uic4
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
@@ -1022,13 +1022,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     )
 
   find_program(QT_LUPDATE_EXECUTABLE
-    NAMES lupdate-qt4 lupdate
+    NAMES lupdate-qt4 lupdate lupdate4
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
   find_program(QT_LRELEASE_EXECUTABLE
-    NAMES lrelease-qt4 lrelease
+    NAMES lrelease-qt4 lrelease lrelease4
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
@@ -1040,13 +1040,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     )
 
   find_program(QT_DESIGNER_EXECUTABLE
-    NAMES designer-qt4 designer
+    NAMES designer-qt4 designer designer4
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
   find_program(QT_LINGUIST_EXECUTABLE
-    NAMES linguist-qt4 linguist
+    NAMES linguist-qt4 linguist linguist4
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )



More information about the cmake-developers mailing list