problems with cmake in kdegraphics

Alexander Neundorf neundorf at kde.org
Thu Apr 20 01:07:59 CEST 2006


On Wednesday 19 April 2006 03:06, Michael Pyne wrote:
> On Tuesday 18 April 2006 13:59, Stefan Kebekus wrote:
> > Hi,
> >
> > I am currently trying to make kviewshell compile with cmake. My problem
> > is that the central cmake script of the kdegraphics package should look
> > for the FreeType2 library, locate the include file "ft2build.h" and add
> > the path to this file to the include path.
> >
> > Since freetype2 is also used by the povmodeler, and is used internally by
> > Qt, I believe that we could reasonable make freetype2 a requirement for
> > kdegraphics.
> >
> > Since I do not feel competent here, I do not want to mess with the
> > CMakeLists, so I wonder if anyone knows how to do that properly?
>
> Even if we make FreeType2 a requirement, it would be nice to detect during
> the configuration process if it is not present rather than waiting for the
> compile to fail.
>
> As far how to do it, I'm not exactly sure, but I assume we could just
> examing the code in one of the existing Find*.cmake files in
> $KDEDIR/share/apps/cmake/modules

There is a ruby script kdelibs/cmake/generate_findpackage_file, which asks you 
some questions and then generates a basic FindFoo.cmake file which should 
work for many cases already.

If FreeType is used in several subdirectories, it is ok to add the check to 
the toplevel CMakeLists.txt,
if it's optional:
macro_optional_find_package(FreeType2)
or if it's required:
find_package(FreeType2 REQUIRED)

After that you can use FREETYPE2_INCLUDE_DIR and FREETYPE2_LIBRARIES whereever 
you need them.

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the Kde-buildsystem mailing list