Building KWin with different define values for multiple targets
Alexander Neundorf
neundorf at kde.org
Sat Jul 2 22:53:20 CEST 2011
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.
You may also make a static library from some of the source files so not
everything has to be compiled twice.
Is this what you want ?
Alex
More information about the Kde-buildsystem
mailing list