Fix FindLibical.cmake in kdepimlibs

Alexander Neundorf neundorf at kde.org
Wed Jan 28 22:11:10 CET 2009


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 ?

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}

Alex


More information about the Kde-buildsystem mailing list