[cmake-developers] General Config.cmake file issue on ArchLinux

Alexander Neundorf neundorf at kde.org
Thu Dec 6 15:53:36 EST 2012


On Thursday 06 December 2012, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> > On Thursday 06 December 2012, Stephen Kelly wrote:
> >> Alexander Neundorf wrote:
> >> > Let's assume /opt/foo/lib/ is a symlink to /usr/local/lib/.
> >> > The package has been installed to /opt/foo/ and is found via
> >> > CMAKE_PREFIX_PATH in /opt/foo/lib/cmake/Foo/FooConfig.cmake.
> >> > Now when going up to the prefix, we will come across /opt/foo/lib/,
> >> > which is a symlink, but everything will be fine, since going up will
> >> > take us to /opt/foo/, from where we can correctly descend again.
> >> 
> >> But that works only if you don't search for anything in bin/ or share/,
> >> right (assuming there are not appropriately similiar(!) symlinks for
> >> those too)?
> > 
> > Hmm, no ?
> > 
> > /opt/foo/lib/cmake/Foo/../../../share/ is /opt/foo/share/, which would be
> > correct (when the package has been installed to /opt/foo/, as said
> > above).
> 
> Ok. Now I'm even more confused.
> 
> I thought /opt/foo/share/ is incorrect. Correct would be /usr/local/share.

No. Above I wrote "has been installed to /opt/foo".
I.e. into /opt/foo/lib/cmake/Foo/FooConfig.cmake and e.g. 
/opt/foo/share/foo/whatever.file

> You are assuming that /opt/foo/share/ is a symlink to /usr/local/share,
> right? 

No, I'm assuming that /opt/foo/lib/ is a symlink to /usr/local/lib/.
So that when installing FooConfig.cmake to the prefix /opt/foo/, this file 
ends up in /opt/foo/lib/cmake/Foo/FooConfig.cmake (via the symlink), which is 
the same as /usr/local/lib/cmake/Foo/FooConfig.cmake (no symlink).
The correct one to be found is the one in /opt/foo/, which contains the 
symlink.

> That's why I wrote 'assuming there are not appropriately similiar(!)
> symlinks for those too'. Isn't exactly that kind of assumption the source
> of the original problem on Arch? They have a symlink for lib, but not for
> bin.
> 
> Are you confused too? Am I making sense?

My confused mind thinks I'm not confused... ;-)

...
> > It doesn't matter whether the location which is found, has been found via
> > the symlink or via a "normal" path. It matters whether the location where
> > it has been found is in the correct prefix.
> 
> Right. 'Correct prefix' is a bit ambiguous though if there is a symlink for
> lib/, but not for anything else. Does that make sense? Do you agree?

No, it's not ambiguous. It's the directory which was as prefix during 
installation (/opt/foo/ above).

Alex



More information about the cmake-developers mailing list