Soprano cmake issue

Alexander Neundorf neundorf at kde.org
Mon Oct 20 00:07:45 BST 2008


On Sunday 19 October 2008, Allen Winter wrote:
> On Saturday 18 October 2008 6:17:35 pm Andreas Pakulat wrote:
> > On 18.10.08 18:26:02, Josef Spillner wrote:
> > > Hello,
> > >
> > > I'm wondering about an issue I've had today with the cmake module of
> > > libsoprano. The standard macro find_path() is used to search for it.
> > > However, find_path() looks into system directories by default, and only
> > > considers the arguments to PATH after that [0].
> >
> > I guess you mean PATHS here. PATH is a well-known environment variable ;)
> >
> > > Which means that an older soprano version
> > > in /usr is preferred to the one from kdesupport which I've installed
> > > into my KDE4 prefix.
> > > The attached patch works for me, though I'm sure it shouldn't be
> > > necessary to add NO_CMAKE_SYSTEM_PATH by hand.
> >
> > That can only be fixed properly with CMake 2.6.2, which allows to set
> > HINTS-paths that are checked before standard system paths. The workaround
> > with cmake 2.6.0/1 is to do 2 find_path's, the first with the
> > NO_CMAKE_SYSTEM_PATH but PATHS parameter, the second without
> > NO_CMAKE_SYSTEM_PATH and hence also searching /usr&co.
> >
> > As requiring cmake 2.6 is probably still a month or two away I think your
> > change for this should go in now.
>
> Agreed.
> If you want to search the a specified order then you need
> NO_CMAKE_SYSTEM_PATH

Better use NO_DEFAULT_PATH, which disables *all* automatically added paths, 
not only the CMAKE_SYSTEM_*_PATH's .

So, first FIND_LIBRARY( <the paths where you expect it> NO_DEFAULT_PATH), 
followed by FIND_LIBRARY( ... no special path arguments)

This will prefer the paths you give explicitely, and the second call will only 
do something if the first one failed.

Alex





More information about the kde-core-devel mailing list