openbsd-ports/databases/strigi/patches/patch-cmake_FindQt4_cmake
espie 2e0676359f update to 0.5.5, required to even try to build new kde snapshot
good surprise: a lot of patches have been integrated.

Doesn't mean it works nice (in fact, half the tests fail), but it's
getting better
2007-10-24 22:49:38 +00:00

190 lines
7.6 KiB
Plaintext

$OpenBSD: patch-cmake_FindQt4_cmake,v 1.2 2007/10/24 22:49:38 espie Exp $
--- cmake/FindQt4.cmake.orig Mon Jul 16 13:26:59 2007
+++ cmake/FindQt4.cmake Thu Oct 25 00:10:55 2007
@@ -184,6 +184,19 @@
# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+## macro for asking qmake to process pro files
+MACRO(QT_QUERY_QMAKE outvar invar)
+ FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
+ "message(CMAKE_MESSAGE<$$${invar}>)")
+ EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
+ WORKING_DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
+ OUTPUT_VARIABLE _qmake_query_output
+ ERROR_VARIABLE _qmake_query_output )
+ FILE(REMOVE_RECURSE
+ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
+ STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
+ENDMACRO(QT_QUERY_QMAKE)
INCLUDE(CheckSymbolExists)
INCLUDE(MacroAddFileDependencies)
@@ -217,7 +230,7 @@ MACRO(QT_QUERY_QMAKE outvar invar)
ENDMACRO(QT_QUERY_QMAKE)
# check for qmake
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS
+FIND_PROGRAM(QT_QMAKE_EXECUTABLE 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"
$ENV{QTDIR}/bin
@@ -557,7 +570,7 @@ IF (QT4_QMAKE_FOUND)
MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_INCLUDE_DIR QT_QT_INCLUDE_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR)
# Set QT_INCLUDES
- SET( QT_INCLUDES ${QT_INCLUDE_DIR} ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default )
+ SET( QT_INCLUDES ${QT_INCLUDE_DIR} ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default)
########################################
@@ -1190,7 +1203,142 @@ IF (QT4_QMAKE_FOUND)
SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(UNIX)
+ IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
+ STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG ${_qconfig_FILE_contents})
+ STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG ${_qconfig_FILE_contents})
+ ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ SET(QT_GUI_LIB_DEPENDENCIES "")
+ SET(QT_CORE_LIB_DEPENDENCIES "")
+ SET(QT_DBUS_LIB_DEPENDENCIES "")
+
+ ## system png
+ IF(QT_QCONFIG MATCHES "system-png")
+ FIND_LIBRARY(QT_PNG_LIBRARY NAMES png)
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_PNG_LIBRARY})
+ MARK_AS_ADVANCED(QT_PNG_LIBRARY)
+ FIND_PATH(QT_PNG_INCLUDE_DIR png.h
+ /usr/local/include
+ /usr/include
+ /usr/local/include/libpng # OpenBSD
+ )
+ MARK_AS_ADVANCED(QT_PNG_INCLUDE_DIR)
+ SET(QT_INCLUDES ${QT_INCLUDES} ${QT_PNG_INCLUDE_DIR})
+
+ ENDIF(QT_QCONFIG MATCHES "system-png")
+
+ IF(QT_QCONFIG MATCHES "glib")
+ FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0)
+ FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0)
+ MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
+ MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
+ ENDIF(QT_QCONFIG MATCHES "glib")
+
+ IF(QT_QCONFIG MATCHES "gnu-libiconv")
+ FIND_LIBRARY(QT_LIBINTL NAMES intl)
+ FIND_LIBRARY(QT_LIBICONV NAMES iconv)
+ MARK_AS_ADVANCED(QT_LIBICONV)
+ MARK_AS_ADVANCED(QT_LIBINTL)
+ SET(QT_CORE_LIB_DEPENDENCIES ${QT_CORE_LIB_DEPENDENCIES} ${QT_LIBICONV} ${QT_LIBICONV})
+ ENDIF(QT_QCONFIG MATCHES "gnu-libiconv")
+
+ IF(QT_QCONFIG MATCHES "qdbus")
+ FIND_LIBRARY(QT_DBUS NAMES dbus-1)
+ MARK_AS_ADVANCED(QT_DBUS)
+ SET(QT_DBUS_LIB_DEPENDENCIES ${QT_DBUS_LIB_DEPENDENCIES} ${QT_DBUS})
+ ENDIF(QT_QCONFIG MATCHES "qdbus")
+ # for X11, get X11 library directory
+ IF(Q_WS_X11)
+ SET(QMAKE_LIBDIR_X11 "/usr/X11R6/lib")
+ ENDIF(Q_WS_X11)
+
+ ## X11 SM
+ IF(QT_QCONFIG MATCHES "x11sm")
+ # ask qmake where the x11 libs are
+ FIND_LIBRARY(QT_X11_SM_LIBRARY NAMES SM PATHS ${QMAKE_LIBDIR_X11})
+ FIND_LIBRARY(QT_X11_ICE_LIBRARY NAMES ICE PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_X11_SM_LIBRARY} ${QT_X11_ICE_LIBRARY})
+ MARK_AS_ADVANCED(QT_X11_SM_LIBRARY)
+ MARK_AS_ADVANCED(QT_X11_ICE_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "x11sm")
+
+ ## Xi
+ IF(QT_QCONFIG MATCHES "tablet")
+ FIND_LIBRARY(QT_XI_LIBRARY NAMES Xi PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_XI_LIBRARY})
+ MARK_AS_ADVANCED(QT_XI_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "tablet")
+
+ ## Xrender
+ IF(QT_QCONFIG MATCHES "xrender")
+ FIND_LIBRARY(QT_XRENDER_LIBRARY NAMES Xrender PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_XRENDER_LIBRARY})
+ MARK_AS_ADVANCED(QT_XRENDER_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "xrender")
+
+ ## Xrandr
+ IF(QT_QCONFIG MATCHES "xrandr")
+ FIND_LIBRARY(QT_XRANDR_LIBRARY NAMES Xrandr PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_XRANDR_LIBRARY})
+ MARK_AS_ADVANCED(QT_XRANDR_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "xrandr")
+
+ ## Xcursor
+ IF(QT_QCONFIG MATCHES "xcursor")
+ FIND_LIBRARY(QT_XCURSOR_LIBRARY NAMES Xcursor PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_XCURSOR_LIBRARY})
+ MARK_AS_ADVANCED(QT_XCURSOR_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "xcursor")
+
+ ## Xinerama
+ IF(QT_QCONFIG MATCHES "xinerama")
+ FIND_LIBRARY(QT_XINERAMA_LIBRARY NAMES Xinerama PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_XINERAMA_LIBRARY})
+ MARK_AS_ADVANCED(QT_XINERAMA_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "xinerama")
+
+ ## system-freetype
+ IF(QT_QCONFIG MATCHES "system-freetype")
+ FIND_LIBRARY(QT_FREETYPE_LIBRARY NAMES freetype)
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_FREETYPE_LIBRARY})
+ MARK_AS_ADVANCED(QT_FREETYPE_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "system-freetype")
+
+ ## fontconfig
+ IF(QT_QCONFIG MATCHES "fontconfig")
+ FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
+ MARK_AS_ADVANCED(QT_FONTCONFIG_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "fontconfig")
+
+ ## system-zlib
+ IF(QT_QCONFIG MATCHES "system-zlib")
+ FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z)
+ SET(QT_CORE_LIB_DEPENDENCIES ${QT_CORE_LIB_DEPENDENCIES} ${QT_ZLIB_LIBRARY})
+ MARK_AS_ADVANCED(QT_ZLIB_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "system-zlib")
+
+ IF(Q_WS_X11)
+ # X11 libraries Qt absolutely depends on
+ QT_QUERY_QMAKE(QT_LIBS_X11 "QMAKE_LIBS_X11")
+ SEPARATE_ARGUMENTS(QT_LIBS_X11)
+ FOREACH(QT_X11_LIB ${QT_LIBS_X11})
+ STRING(REGEX REPLACE "-l" "" QT_X11_LIB "${QT_X11_LIB}")
+ SET(QT_TMP_STR "QT_X11_${QT_X11_LIB}_LIBRARY")
+ FIND_LIBRARY(${QT_TMP_STR} NAMES "${QT_X11_LIB}" PATHS ${QMAKE_LIBDIR_X11})
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${${QT_TMP_STR}})
+ ENDFOREACH(QT_X11_LIB)
+
+ QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD")
+ SET(QT_CORE_LIB_DEPENDENCIES ${QT_CORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD})
+
+ QT_QUERY_QMAKE(QMAKE_LIBS_DYNLOAD "QMAKE_LIBS_DYNLOAD")
+ SET (QT_CORE_LIB_DEPENDENCIES ${QT_CORE_LIB_DEPENDENCIES} ${QMAKE_LIBS_DYNLOAD})
+
+ ENDIF(Q_WS_X11)
+
#######################################
#
# compatibility settings
@@ -1218,4 +1366,3 @@ ELSE(QT4_QMAKE_FOUND)
ENDIF(Qt4_FIND_REQUIRED)
ENDIF (QT4_QMAKE_FOUND)
-