Fix FindLibical.cmake in kdepimlibs

Andreas Pakulat apaku at gmx.de
Wed Jan 28 23:43:04 CET 2009


On 28.01.09 22:11:10, Alexander Neundorf wrote:
> On Wednesday 28 January 2009, Andreas Pakulat wrote:
> > Hi,
> >
> > currently FindLibical.cmake doesn't produce a proper LIBICAL_INCLUDE_DIRS
> > variable. That variable always contains the PATH_SUFFIX which means its
> > <prefix>/include/libical. However the libical headers themselves expect
> > only <prefix>/include to be set as include dir.
> >
> > This works fine as long as one has libical installed from packages under
> > /usr or some other common prefix that also included in the list of
> > include-dirs for a project.
> >
> > It breaks as soon as one installs libical to a non-common place.
> >
> > The attached patch fixes that and additionally replaces the REPLACE-stuff
> > with TO_CMAKE_PATH (as that seems to be the intention) and also fixes the
> > wrong usage of find_path/find_library with NO_CMAKE_SYSTEM_PATH.
> >
> > The regex-replace is ugly, but I don't know wether there are systems on
> > which ical.h would be directly in <prefix>/include. If we are certain that
> > there are no such systems we can remove the regex-replace and the
> > PATH_SUFFIXES and instead add libical/ to the NAMES for find_path.
> 
> How about doing
> find_path(LIBICAL_INCLUDE_DIRS NAMES libical/ical.h ... )
> then ?

That should only be done if ical installs a libical subdir for the headers
on any platform in all configurations. As I have no idea about ical myself
I didn't do that.
 
> Or how about checking for both ?
> Something like:
> 
> find_path(LIBICAL_ICAL_H_DIR NAMES ical.h ... )
> find_path(LIBICAL_LIBICAL_ICAL_H_DIR NAMES libical/ical.h ... )
> set(LIBICAL_INCLUDE_DIRS ${LIBICAL_ICAL_H_DIR} ${LIBICAL_LIBICAL_ICAL_H_DIR}

That might work better, yeah. 

Andreas

-- 
Generosity and perfection are your everlasting goals.


More information about the Kde-buildsystem mailing list