[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-maemo
Subject:    Re: [Kde-maemo] kdelibs modularizing (kde-mobile)
From:       Kevin Ottens <ervin () kde ! org>
Date:       2010-04-27 6:42:05
Message-ID: 201004270842.12804.ervin () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Monday 12 April 2010 18:51:41 Alexander Neundorf wrote:
> On Monday 12 April 2010, Kevin Ottens wrote:
> > On Saturday 10 April 2010 19:34:14 Alexander Neundorf wrote:
> > > Doesn't look too bad, but I wouldn't commit it before there is
> > > something which also uses this.
> > 
> > Well, it's chicken and egg problem. We kind need it in order to start the
> > efforts of cutting deps and so on which will use the content of this
> > patch.
> > 
> > :-)
> > 
> > Actually, the sooner it gets in, the sooner I can really start doing the
> > dependency cuts.
> 
> How about putting it in together with the first use of it ?

Wise man you are. While working on cutting deps in libplasma which is a nice 
guinea pig there, I reworked the cmake related parts.

There's two things the previous patch wasn't up to:
 - Keeping the high level controlling variable (profile and platform features) 
out of the C++ realm by default;
 - Easily finding out from cmake what was the profile of kdelibs (which other 
modules forming our platform should follow, kdepimlibs for instance but 
probably others).

So I took a different path, namely shipping an extra KDEPlatformProfile.cmake 
with kdelibs just like we ship a KDELibsDependenciesFile.cmake right now.

Please find attached two patches against kdelibs (I left out the purely C++ 
related changes in libplasma that Aaron already reviewed). 
kdelibs_cmake_profiles.patch are the changes to our overall kdelibs build with 
the new profile file installation, kdelibs_plasma_profiles.patch shows the 
changes we would do to a lib build to take care of the platform features 
declared by the profile.

Please let me know if they're good to go. On my side they're ready to be 
committed.

Regards.
-- 
Kévin Ottens, http://ervin.ipsquad.net

KDAB - proud patron of KDE, http://www.kdab.com

["kdelibs_cmake_profiles.patch" (text/x-patch)]

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1119002)
+++ CMakeLists.txt	(working copy)
@@ -29,6 +29,8 @@
    set (__KDE_HAVE_GCC_VISIBILITY 0)
 endif (KHTML_BUILD_TESTREGRESSION)
 
+################# write platform profile file which will be installed \
################# +include(CreateKDEPlatformProfile.cmake)
 
 ################# now find all used packages #################
 
@@ -298,6 +300,7 @@
 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kdemacros.h  DESTINATION  \
${INCLUDE_INSTALL_DIR} )  install( FILES ${CMAKE_CURRENT_BINARY_DIR}/config-nepomuk.h \
DESTINATION  ${INCLUDE_INSTALL_DIR} )  install( FILES \
${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake DESTINATION \
${DATA_INSTALL_DIR}/cmake/modules) +install( FILES \
${CMAKE_CURRENT_BINARY_DIR}/KDEPlatformProfile.cmake  DESTINATION \
${DATA_INSTALL_DIR}/cmake/modules)  
 
 # run a script before installing the exports files which deletes previously \
                installed
Index: CreateKDEPlatformProfile.cmake
===================================================================
--- CreateKDEPlatformProfile.cmake	(revision 0)
+++ CreateKDEPlatformProfile.cmake	(revision 0)
@@ -0,0 +1,45 @@
+# this file is included by kdelibs/CMakeLists.txt and contains the cmake code
+# which creates the KDEPlatformProfile.cmake file, which is installed by kdelibs
+
+######## write profile file which will be installed #########
+
+# Desktop profile (default profile)
+if (KDE_PLATFORM_PROFILE STREQUAL "Desktop" OR NOT KDE_PLATFORM_PROFILE)
+    set(KDE_PLATFORM_PROFILE "Desktop")
+    set(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION FALSE)
+    set(KDE_PLATFORM_FEATURE_BINARY_INCOMPATIBLE_FEATURE_REDUCTION FALSE)
+    set(KDE_PLATFORM_FEATURE_KIO_INPROCESS FALSE)
+    set(KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED FALSE)
+endif (KDE_PLATFORM_PROFILE STREQUAL "Desktop" OR NOT KDE_PLATFORM_PROFILE)
+
+# Tablet profile
+if (KDE_PLATFORM_PROFILE STREQUAL "Tablet")
+    set(KDE_PLATFORM_PROFILE "Tablet")
+    set(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION TRUE)
+    set(KDE_PLATFORM_FEATURE_BINARY_INCOMPATIBLE_FEATURE_REDUCTION FALSE)
+    set(KDE_PLATFORM_FEATURE_KIO_INPROCESS FALSE)
+    set(KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED FALSE)
+    message(STATUS "KDE Platform Profile: TABLET")
+endif (KDE_PLATFORM_PROFILE STREQUAL "Tablet")
+
+# Mobile profile
+if (KDE_PLATFORM_PROFILE STREQUAL "Mobile")
+    set(KDE_PLATFORM_PROFILE "Mobile")
+    set(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION TRUE)
+    set(KDE_PLATFORM_FEATURE_BINARY_INCOMPATIBLE_FEATURE_REDUCTION TRUE)
+    set(KDE_PLATFORM_FEATURE_KIO_INPROCESS TRUE)
+    set(KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED TRUE)
+    message(STATUS "KDE Platform Profile: MOBILE. Please be aware that this version \
of the KDE platform is BINARY INCOMPATIBLE to standard KDE. At this time no binary \
compatiblity is guaranteed even within the mobile target.") +endif \
(KDE_PLATFORM_PROFILE STREQUAL "Mobile") +
+
+# Writing the profile file
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/KDEPlatformProfile.cmake
+"# this file was generated during the kdelibs build process
+set(KDE_PLATFORM_PROFILE \"${KDE_PLATFORM_PROFILE}\")
+set(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION \
${KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION}) \
+set(KDE_PLATFORM_FEATURE_BINARY_INCOMPATIBLE_FEATURE_REDUCTION \
${KDE_PLATFORM_FEATURE_BINARY_INCOMPATIBLE_FEATURE_REDUCTION}) \
+set(KDE_PLATFORM_FEATURE_KIO_INPROCESS ${KDE_PLATFORM_FEATURE_KIO_INPROCESS}) \
+set(KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED \
${KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED}) +")
+
Index: cmake/modules/FindKDE4Internal.cmake
===================================================================
--- cmake/modules/FindKDE4Internal.cmake	(revision 1119002)
+++ cmake/modules/FindKDE4Internal.cmake	(working copy)
@@ -499,8 +499,9 @@
       get_filename_component(QT_INSTALL_DIR ${_DIR} PATH )
    endif (WIN32)
 
-   # This file contains information about the installed kdelibs, Alex
+   # These files contain information about the installed kdelibs, Alex
    include(${kde_cmake_module_dir}/KDELibsDependencies.cmake)
+   include(${kde_cmake_module_dir}/KDEPlatformProfile.cmake)
 
    # Check the version of KDE. It must be at least KDE_MIN_VERSION as set by the \
user.  # KDE_VERSION is set in KDELibsDependencies.cmake since KDE 4.0.x. Alex


["kdelibs_plasma_profiles.patch" (text/x-patch)]

Index: plasma/CMakeLists.txt
===================================================================
--- plasma/CMakeLists.txt	(revision 1119002)
+++ plasma/CMakeLists.txt	(working copy)
@@ -1,15 +1,15 @@
 # strange conversion error in pushbutton.cpp
 kde4_no_enable_final(plasma)
 
+if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
+    set(PLASMA_NO_KDEWEBKIT TRUE)
+    set(PLASMA_NO_KNEWSTUFF TRUE)
+    set(PLASMA_NO_SOLID TRUE)
+endif(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}
                     ${KDE4_KDECORE_INCLUDES}
                     ${KDE4_KDEUI_INCLUDES}
-                    ${KDE4_KIO_INCLUDES}
-                    ${CMAKE_SOURCE_DIR}/kdewebkit/
-                    ${CMAKE_SOURCE_DIR}/knewstuff/
-                    ${CMAKE_BINARY_DIR}/solid/
-                    ${CMAKE_SOURCE_DIR}/solid/
                     ${CMAKE_SOURCE_DIR}/threadweaver/
                     ${CMAKE_SOURCE_DIR}/plasma/extenders
                     ${CMAKE_SOURCE_DIR}/plasma/remote
@@ -20,6 +20,19 @@
                     ${KDE4_INCLUDES}
                     )
 
+if(NOT PLASMA_NO_KDEWEBKIT)
+    include_directories(${CMAKE_SOURCE_DIR}/kdewebkit/)
+endif(NOT PLASMA_NO_KDEWEBKIT)
+
+if(NOT PLASMA_NO_KNEWSTUFF)
+    include_directories(${CMAKE_SOURCE_DIR}/knewstuff/)
+endif(NOT PLASMA_NO_KNEWSTUFF)
+
+if(NOT PLASMA_NO_SOLID)
+    include_directories(${CMAKE_BINARY_DIR}/solid/)
+    include_directories(${CMAKE_SOURCE_DIR}/solid/)
+endif(NOT PLASMA_NO_SOLID)
+
 if(QCA2_FOUND)
     include_directories(${QCA2_INCLUDE_DIR})
     set(ENABLE_REMOTE_WIDGETS TRUE)
@@ -216,10 +229,21 @@
 
 kde4_add_library(plasma SHARED ${plasma_LIB_SRCS})
 
-target_link_libraries(plasma ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} knewstuff3
-                             ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY} kdewebkit
-                             kdnssd threadweaver ${KDE4_SOLID_LIBS} )
+target_link_libraries(plasma ${KDE4_KIO_LIBS} ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY}
+                             kdnssd threadweaver)
 
+if(NOT PLASMA_NO_KDEWEBKIT)
+    target_link_libraries(plasma kdewebkit)
+endif(NOT PLASMA_NO_KDEWEBKIT)
+
+if(NOT PLASMA_NO_KNEWSTUFF)
+    target_link_libraries(plasma knewstuff3)
+endif(NOT PLASMA_NO_KNEWSTUFF)
+
+if(NOT PLASMA_NO_SOLID)
+    target_link_libraries(plasma ${KDE4_SOLID_LIBS})
+endif(NOT PLASMA_NO_SOLID)
+
 if(QCA2_FOUND)
    target_link_libraries(plasma ${QCA2_LIBRARIES})
 endif(QCA2_FOUND)
Index: plasma/config-plasma.h.cmake
===================================================================
--- plasma/config-plasma.h.cmake	(revision 1119002)
+++ plasma/config-plasma.h.cmake	(working copy)
@@ -1,3 +1,7 @@
 #cmakedefine ENABLE_REMOTE_WIDGETS
 #cmakedefine QCA2_FOUND
 
+#cmakedefine PLASMA_NO_KDEWEBKIT
+#cmakedefine PLASMA_NO_KNEWSTUFF
+#cmakedefine PLASMA_NO_SOLID
+

["signature.asc" (application/pgp-signature)]

_______________________________________________
Kde-maemo mailing list
Kde-maemo@kde.org
https://mail.kde.org/mailman/listinfo/kde-maemo


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic