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

Alexander Neundorf neundorf at kde.org
Mon Jan 21 14:09:57 EST 2013


On Sunday 18 November 2012, Andrea Scarpino wrote:
> On Saturday 17 November 2012 20:24:42 you wrote:
> > Hi,
> > 
> > maybe I am missing something, but here we go:
> > 
> > on 64bit ArchLinux installations, /lib64/ is a symlink to /usr/lib/.
> > /bin/ and /usr/bin/ are normal directories, no symlinks.
> 
> Hi Alexander,
> that's true, anyway we'll symlink /bin to /usr/bin in the next year.
> 
> > Now if a Config.cmake files is installed into /usr/lib/foo/, and
> > references other files of its installations using relative paths from
> > its own location to e.g. /usr/bin/ (../../bin/ ), there is breakage.
> 
> Note, that this only applies when $PATH contains a different order than the
> default one we ship; which is
> PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin".
> 
> In detail, when /bin is before /usr/bin cmake looks for the binary in /bin.
> 
> > CMake finds FooConfig.cmake in /lib64/foo/FooConfig.cmake (which it seems
> > to search before /usr/lib). Then it goes ../../bin/, but doesn't end up
> > in /usr/bin/, where e.g. some executable is located, but instead it goes
> > to /lib64/foo/../../bin/, which is /bin/, but the expected executable is
> > not there, and so the FooConfig.cmake file fails.
> 
> I'm not familiar with the cmake code, but I guess that the different PATH
> order I said above cause cmake to take the FooConfig.cmake file from
> /lib64 rather than /usr/lib.
> 
> > If so, maybe the best thing to do is to tell the ArchLinux developers to
> > set up their symlinks in a different way ?
> > Having e.g. /usr/lib64/ point to /usr/lib/ would make it work I think.
> > Or if /lib64/ points to /usr/lib/, then maybe /bin/ should also point to
> > /usr/bin/.
> 
> We are going to move everything to /usr. As I said above /bin will be
> symlinked to /usr/bin in the next year.

what about /include/ ?
This typically does not exist, but this will also make the Config.cmake files 
fail.
The Config.cmake files typically reference the include/ subdir, relativ to 
their own position. If there is no /include/, which is symlinked to 
/usr/include/, this will fail too.
The same for share/ and the other subdirs, but they are somewhat less common.

Alex



More information about the cmake-developers mailing list