Cross compiling page in techbase

Alexander Neundorf neundorf at kde.org
Tue Mar 11 21:47:39 CET 2008


On Tuesday 11 March 2008, Carlo wrote:
> On Tue, Mar 11, 2008 at 7:45 PM, Alexander Neundorf <neundorf at kde.org> 
wrote:
> > On Tuesday 11 March 2008, Carlo wrote:
> >  > Hi, i've added a page in techbase with instruction to crosscompile kde
> >  > for windows from linux
> >  > http://techbase.kde.org/index.php?title=Getting_Started/Build/KDE4/Win
> >  >dows/ CrossCompiling and i've linked it to
> >
> >  Wow, _very_ cool ! :-)
> >
> >  Some questions:
> >
> >  Why do you need to preset all the variables starting with
> > KDE4_INSTALL_DIR, especially the KDE4_XXX_LIBRARY variables ?
>
> KDE4_INSTALL_DIR is just for convenience so you don't have to modify

Why do you have to set CMAKE_MODULE_PATH ? This really shouldn't be necessary. 
It is set at the top of kdelibs/CMakeLists.txt. What doesn't work there ?

Why do you set the KDE4_xxx_LIBRARY variables ? They also really shouldn't be 
necessary. What are the errors ?

> the path for all set, I have to specify some kde/qt library because
> cmake can't find them itself and 
> i have disabled dnssd/avahi etc..

That's ok.

> because cmake find the linux one and think that it's good

This shouldn't happen.
For which packages does it find the wrong versions ?
Can you please post the complete list, with the location of the windows 
versions and what cmake found ?
(maybe these are packages where pkg-config is used...)

> >  Some comments:
> >  > you have to make a link to your kde4automoc for linux in the bin
> >  > directory
> >
> >  we should be able to fix that...
> >
> >  > since linux is case sensitive you have to make symbolic links for some
> >  > headers
> >
> >  Can't this be corrected in the source files where the headers are
> > included ?
>
> yeah this can be fixed in the source file too(maybe soprano would
> require an ifdef since there are both soprano and Soprano on linux),
> but link was easier to do

We should definitely fix it. 
Can you commit or do you have to create a patch ?

> >  > You will get a linker error on kjsembed so from the build directory cd
> >  > into kjsembed/kjsembed and make VERBOSE=1 2>/dev/null
> >
> >  what's the problem here with linking ?
> >  This shouldn't happen, we have to fix it.
>
> it's a long linker error about QtUiTools it can't find anything
> related to qt(QString, QDataStream etc..)

Can you please post the linker command and the complete error message ?

> >  > You will get another error in klauncher.moc about slotKDEInitData so
> >  > go into kinit and do something like this(you need wine)
> >
> >  What's the exact problem here ?
> >  Does the Windows moc have to be used ? Why ?
>
> slotKDEInitData doesn't exist on windows
> http://lxr.kde.org/source/KDE/kdelibs/kinit/klauncher.h#179 but
> kde4automoc thinks that we are on linux maybe, so maybe we should use
> the windows version for everything

Hmm, if we are cross compiling to Windows Q_WS_WIN should be defined.
Can you find out why it isn't ?

> >  > Another error in kdewidgets because wine doesn't find some dll to run
> >  > makekdewidgets.exe so either run the linux version manually like this
> >
> >  So you run the generated executables using wine ? Interesting. The idea
> > was to use "native" executables if cross compiling. But if it works, ok.
> >
> >  Alex
>
> for some strange reason for kde4automoc it calls ../bin/kde4automoc
> instead of ../bin/kde4automoc.exe one that's why i made the link in
> the bin dir, but for makekdewidgets it wants to use the exe one

Can you please have a look at FindKDE4Internal.cmake.
There you will find this code:

if (_kdeBootStrapping)
   set(KDE4_INCLUDE_DIR ${kdelibs_SOURCE_DIR})
   set(KDE4_KDECORE_LIBS ${QT_QTCORE_LIBRARY} kdecore)
   ...
   if (WIN32)
      set(LIBRARY_OUTPUT_PATH            ${EXECUTABLE_OUTPUT_PATH} )
      ...
   else (WIN32)
      set(LIBRARY_OUTPUT_PATH            ${CMAKE_BINARY_DIR}/lib )
      ...
   endif (WIN32)

which branch does it enter here ?
I assume it goes into the else() branch, which is wrong for cross compiling to 
Windows.
Does it change if you replace the
if(WIN32)
with 
if (CMAKE_SYSTEM MATCHES Windows) 
?

(when cross compiling CMAKE_SYSTEM is for the target system, CMAKE_HOST_SYSTEM 
is for the build host, WIN32, UNIX and APPLE are for the build host).

Alex



More information about the Kde-windows mailing list