Building KWin with different define values for multiple targets
Martin Gräßlin
mgraesslin at kde.org
Sun Jul 17 20:02:41 CEST 2011
On Saturday 02 July 2011 22:53:20 you wrote:
> On Wednesday 29 June 2011, Martin Gräßlin wrote:
> > Hi Buildsystem experts,
> >
> > I am currently facing an issue with build system changes for KWin where I
> > do not know whether what I want to achieve is possible at all and if it is
> > how to implement it.
> >
> > First some context:
> > In 4.7 KWin can be built either with OpenGL/GLX or OpenGL ES 2/EGL support.
> > OpenGL ES 2 is a subset (and superset) of OpenGL 2. This means we have to
> > ifdef all the OpenGL code not available in OpenGL ES. It also means that
> > distros have to build two packages if they want to offer kwin with GLES
> > support.
> >
> > I would like to change this in a way that kwin is built twice, once with
> > OpenGL and once with OpenGL ES. I think I need to have the same set of
> > sources used in different targets. Therefore I need to change the define
> > values, e.g. when building for OpenGL I don't want to have OpenGL ES
> > defined and vice versa.
> >
> > Is that possible through cmake? I tried with configure_file but did not
> > succeed so far.
>
> You can e.g. use the same list of source files for two targets, and use
> set_target_properties(... COMPILE_FLAGS ...) to give them a different -
> DKWIN_SOMETHING=GLES.
Thanks for the hint, that works awesomely, I just added a review request with exactly what I
wanted (#101979).
>
> You may also make a static library from some of the source files so not
> everything has to be compiled twice.
Would be nice, unfortunately kwin is a kdeinit project, so no static libraries :-(
>
> Is this what you want ?
Yes :-)
Cheers
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20110717/9246023c/attachment.sig
More information about the Kde-buildsystem
mailing list