[Kde-maemo] KDE/kdelibs

Alexis Ménard menard at kde.org
Mon Feb 22 09:58:13 CET 2010


On Sun, Feb 21, 2010 at 4:13 PM, Alexander Neundorf <neundorf at kde.org> wrote:
> Hi Harald,
>
> On Saturday 20 February 2010, Harald Fernengel wrote:
>> SVN commit 1093415 by harald:
>>
>> Bring Cross compilation to kdelibs
>
> nice that you are working on this :-)
>
> But there are several things which should be done differently.
> Posting the patches for review first would have been nice actually.
> Comments below...
>

I think he was so happy to be able to build kdelibs without scratchbox
that he forgot the basic steps :D

/me thinks about his own frustration of using Scratchbox.

>> With these changes, I was able to cross-compile kdelibs for Maemo 5
>> using MADDE.  See http://techbase.kde.org/Projects/KDE_on_Maemo/MADDE
>> for more details.
>>
>> CCMAIL: kde-maemo at kde.org
>>
>>  M  +3 -1      CMakeLists.txt
>>  M  +2 -2      cmake/modules/FindKDE4Internal.cmake
>>  M  +19 -0     cmake/modules/KDE4Macros.cmake
>>  M  +16 -6     kdecore/kconfig_compiler/CMakeLists.txt
>>  M  +20 -10    kdoctools/CMakeLists.txt
>>  M  +20 -13    kjs/CMakeLists.txt
>>
>>
>> --- trunk/KDE/kdelibs/cmake/modules/FindKDE4Internal.cmake #1093414:1093415
>> @@ -1159,7 +1159,7 @@
>>        string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)"
>> _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}") endif
>> (GCC_IS_NEWER_THAN_4_1)
>>
>> -   if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT
>>         _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
>> +   if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT
>>         _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32 AND NOT
>>         CMAKE_CROSSCOMPILING)
>> set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
>> set (KDE4_C_FLAGS "-fvisibility=hidden")
>
>
> Why do you need the NOT CMAKE_CROSSCOMPILING here ?
> I think there must be some actual condition which should be tested against.
>
>> --- trunk/KDE/kdelibs/cmake/modules/KDE4Macros.cmake #1093414:1093415
>> @@ -106,6 +106,12 @@
>>             file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH})
>>         endif(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}")
>>
>> +       if (CMAKE_CROSSCOMPILING)
>> +           set(IMPORT_KCONFIG_COMPILER_EXECUTABLE
>> "${KDE_HOST_TOOLS_PATH}/ImportKConfigCompilerExecutable.cmake" CACHE
>> FILEPATH "Point it to the export file of kconfig_compiler from a native
>> build")
>> +           include(${IMPORT_KCONFIG_COMPILER_EXECUTABLE})
>> +           set(KDE4_KCFGC_EXECUTABLE kconfig_compiler)
>> +       endif (CMAKE_CROSSCOMPILING)
>> +
>>         # the command for creating the source file from the kcfg file
>>         add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE}
>>            COMMAND ${KDE4_KCFGC_EXECUTABLE}
>
>
> Ok, this part needs to be changed, along with all other places where such an
> import-file is included. For more see below.
>
>
>> trunk/KDE/kdelibs/kdecore/kconfig_compiler/CMakeLists.txt #1093414:1093415
>> @@ -1,18 +1,28 @@
>>
>>  ########### next target ###############
>>
>> -set(kconfig_compiler_SRCS kconfig_compiler.cpp)
>> +if (CMAKE_CROSSCOMPILING)
>> +   SET(IMPORT_KCONFIG_COMPILER_EXECUTABLE
>> "${KDE_HOST_TOOLS_PATH}/ImportKConfigCompilerExecutable.cmake" CACHE
>> FILEPATH "Point it to the export file of kconfig_compiler from a native
>> build")
>> +   INCLUDE(${IMPORT_KCONFIG_COMPILER_EXECUTABLE})
>> +   SET(KDE4_KCFGC_EXECUTABLE kconfig_compiler)
>> +else (CMAKE_CROSSCOMPILING)
>>
>> +   set(kconfig_compiler_SRCS kconfig_compiler.cpp)
>>
>> -kde4_add_executable(kconfig_compiler NOGUI ${kconfig_compiler_SRCS})
>>
>> -target_link_libraries(kconfig_compiler  ${QT_QTCORE_LIBRARY}
>> ${QT_QTXML_LIBRARY} ) +    kde4_add_executable(kconfig_compiler NOGUI
>> ${kconfig_compiler_SRCS})
>>
>> -# "export" this target too so we can use the LOCATION property of the
>> imported target in
>> -# FindKDE4Internal.cmake to get the full path to the
>> installed executable instead of using FIND_PROGRAM(), Alex
>> -install(TARGETS
>> kconfig_compiler EXPORT kdelibsToolsTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
>> )
>> +    target_link_libraries(kconfig_compiler  ${QT_QTCORE_LIBRARY}
>> ${QT_QTXML_LIBRARY} )
>>
>> +    # "export" this target too so we can use the LOCATION property of the
>> imported target in
>> +    # FindKDE4Internal.cmake to get the full path to
>> the installed executable instead of using FIND_PROGRAM(), Alex
>> +   install(TARGETS kconfig_compiler EXPORT kdelibsToolsTargets
>> ${INSTALL_TARGETS_DEFAULT_ARGS} )
>>
>> +    # export this binary for cross-compilation
>> +    EXPORT(TARGETS kconfig_compiler FILE
>> ${CMAKE_BINARY_DIR}/ImportKConfigCompilerExecutable.cmake)
>> +endif(CMAKE_CROSSCOMPILING)
>
> This should not be done.
> As you have seen, there is already an export set with all the tools from
> kdelibs created, named kdelibsToolsTargets and installed
> as "KDELibs4ToolsTargets.cmake".
>
> This file should be included in the cross compiling case, and the targets from
> it should be used in the custom commands.
> This should be done in FindKDE4Internal.cmake, where all the executables are
> set up.
> In the toplevel CMakeLists.txt of kdelibs a custom target
> like "BuildKDELibs4Tools" should be created, and via add_dependencies() all
> the executables which belong to this should be added as dependencies, so you
> can just do "make BuildKDELibs4Tools" and it will build all these tools.
>
> The logic not to build a native kconfig_compiler for e.g. ARM in the cross
> compiling case is probably ok, we will see.
>
> So, main point: try to use the existing KDELibs4ToolsTargets.cmake, include it
> in FindKDE4Internal.cmake and set the KDE4_xxx_EXECUTABLE variables there
> accordingly.
>
> Alex
> _______________________________________________
> Kde-maemo mailing list
> Kde-maemo at kde.org
> https://mail.kde.org/mailman/listinfo/kde-maemo
>


More information about the Kde-buildsystem mailing list