[kde-freebsd] Compiling KDE4 with KDE3

David Naylor blackdragon at highveldmail.co.za
Sun Jan 27 15:34:21 CET 2008


Hi,

In order to compile KDE4 with KDE3 you need to patch kdelibs4, or more
precisely you need to fix the cmake modules that kdelibs4 installs
(therefore no need to rebuild kdelibs4, just change the
share/cmake/modules? Find* files)

The problem is QT_INCLUDE directive, it needs to be last (QT_INCLUDE
is made up of many different include paths and QT_INCLUDE_DIR needs to
be the last on in QT_INCLUDE...)

The cmake modules to change are FindQt4 FindKDE4Internal.

The following patch is from memory any may not work correctly, but is
the general idea.

If we are not going to have kde4 in its own prefix (as in
$PREFIX/kde4) but merge it into the relative directories (as in
include/kde4, lib/kde4, etc) then it will be very helpful if the
#include directives were fixed (especially for Qt stuff).

(((
If we were to change the #include directives, would it be accepted
upstream?  If so we could hurry and get it included in 4.0.1 (but it
must/should be in 4.1)
)))

David

diff -uNrd cmake~/modules/FindKDE4Internal.cmake
cmake/modules/FindKDE4Internal.cmake
--- cmake~/modules/FindKDE4Internal.cmake	2008-01-27 16:28:59.000000000 +0000
+++ cmake/modules/FindKDE4Internal.cmake	2008-01-27 16:31:07.000000000 +0000
@@ -1024,7 +1024,7 @@

 #add the found Qt and KDE include directories to the current include path
 #the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes,
eg. #include <KMainWindow>
-set(KDE4_INCLUDES ${QT_INCLUDES} ${KDE4_INCLUDE_DIR}
${KDE4_INCLUDE_DIR}/KDE ${_KDE4_PLATFORM_INCLUDE_DIRS} )
+set(KDE4_INCLUDES ${KDE4_INCLUDE_DIR} ${KDE4_INCLUDE_DIR}/KDE
${_KDE4_PLATFORM_INCLUDE_DIRS} ${QT_INCLUDES} )

 set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_STL
-DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS )

diff -uNrd cmake~/modules/FindQt4.cmake cmake/modules/FindQt4.cmake
--- cmake~/modules/FindQt4.cmake	2008-01-27 16:28:59.000000000 +0000
+++ cmake/modules/FindQt4.cmake	2008-01-27 16:30:18.000000000 +0000
@@ -604,7 +604,7 @@
   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_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default
${QT_INCLUDE_DIR} )


   ########################################
@@ -833,7 +833,7 @@

     IF (QT_${basename}_INCLUDE_DIR)
       #add the include directory to QT_INCLUDES
-      SET(QT_INCLUDES ${QT_INCLUDES} "${QT_${basename}_INCLUDE_DIR}")
+      SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
     ENDIF (QT_${basename}_INCLUDE_DIR)

     # Make variables changeble to the advanced user


More information about the kde-freebsd mailing list