Build KDE on Mac OS with Qt Framework (Patch for FindQt4.cmake)
younker
mac.younker at gmail.com
Sat Jun 9 17:37:01 BST 2007
I have tried some times to build KDE svn version on my Mac OS X, but
everytime I failed on finding the symbol Q_WS_MAC when doing
configuration with my Qt4 framework installation.
Today, I did some test and found maybe the problem is caused by the
installation path of Qt4, I installed it to /opt/Qt4 which is not the
default framework path, so when cmake check the symbol, it always fail
on link the framework(maybe), so I modified the FindQt4.cmake file and
make it use QT_LIBRARY_DIR as the framework path when link the library.
Below is a patch that I made for FindQt4.cmake of strigi, it does work.
Index: FindQt4.cmake
===================================================================
--- FindQt4.cmake (revision 673233)
+++ FindQt4.cmake (working copy)
@@ -319,7 +319,6 @@
SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "")
ENDIF(NOT QT_HEADERS_DIR)
-
# ask qmake for the documentation directory
IF (NOT QT_DOC_DIR)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
@@ -382,7 +381,12 @@
SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
# Check for Window system symbols (note: only one should end up being set)
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
- CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
+ IF( QT_USE_FRAMEWORKS )
+ SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
+ CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
+ ELSE( QT_USE_FRAMEWORKS )
+ CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
+ ENDIF( QT_USE_FRAMEWORKS )
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
IF (QT_QTCOPY_REQUIRED)
More information about the kde-core-devel
mailing list