openbsd-ports/devel/cmake/patches/patch-Modules_FindQt4_cmake
dcoppa 4cd9f900fc Update to cmake-2.8.4.
Tested in a bulk build by landry@.
Lot of feedback from various people on ports@: thanks!

OK landry@, sthen@
2011-03-13 18:23:01 +00:00

61 lines
2.2 KiB
Plaintext

$OpenBSD: patch-Modules_FindQt4_cmake,v 1.10 2011/03/13 18:23:02 dcoppa Exp $
--- Modules/FindQt4.cmake.orig Tue Feb 15 18:47:27 2011
+++ Modules/FindQt4.cmake Mon Mar 7 10:10:46 2011
@@ -464,13 +464,20 @@ GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRE
# check for qmake
# Debian uses qmake-qt4
# macports' Qt uses qmake-mac
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac 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
- DOC "The qmake executable for the Qt installation to use"
-)
+IF(CMAKE_SYSTEM MATCHES "OpenBSD*")
+ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 PATHS
+ $ENV{QTDIR}/bin
+ DOC "The qmake executable for the Qt installation to use"
+ )
+ELSE(CMAKE_SYSTEM MATCHES "OpenBSD*")
+ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac 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
+ DOC "The qmake executable for the Qt installation to use"
+ )
+ENDIF(CMAKE_SYSTEM MATCHES "OpenBSD*")
IF (QT_QMAKE_EXECUTABLE)
@@ -967,6 +974,12 @@ IF (QT4_QMAKE_FOUND)
_QT4_ADJUST_LIB_VARS(QAxContainer)
ENDIF(Q_WS_WIN)
+ # Qt4 on OpenBSD needs to be linked with -pthread
+ IF(CMAKE_SYSTEM MATCHES "OpenBSD*")
+ FIND_PACKAGE(Threads)
+ SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY}
+ ${CMAKE_THREAD_LIBS_INIT})
+ ENDIF(CMAKE_SYSTEM MATCHES "OpenBSD*")
#######################################
#
@@ -991,13 +1004,13 @@ IF (QT4_QMAKE_FOUND)
ENDIF(QT_QMAKE_CHANGED)
FIND_PROGRAM(QT_MOC_EXECUTABLE
- NAMES moc-qt4 moc
+ NAMES moc4 moc-qt4 moc
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_UIC_EXECUTABLE
- NAMES uic-qt4 uic
+ NAMES uic4 uic-qt4 uic
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)