Fix FindLibical.cmake in kdepimlibs

Allen Winter winter at kde.org
Thu Jan 29 00:20:50 CET 2009


On Wednesday 28 January 2009 5:43:04 pm Andreas Pakulat wrote:
> 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.
>  
All ical headers should be installed in $prefix/include/libical
However, we do install a backwards compatibility header called ical.h
which is installed in $prefix/include. 

$prefix/include/libical/ical.h is the header that really matters.

> > 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
> 


More information about the Kde-buildsystem mailing list