[CMake] Should CMake use /etc/ld.so.conf.d for find_library's CMAKE_SYSTEM_LIBRARY_PATH?

James Bigler jamesbigler at gmail.com
Thu Jan 20 13:24:59 EST 2011


On Thu, Jan 20, 2011 at 10:47 AM, Rolf Eike Beer <eike at sf-mail.de> wrote:

> > On Thursday 20 January 2011, James Bigler wrote:
> > > I'm noticing that on some systems they package the NVIDIA driver into
> > > different directories than the driver is typically installed.   In
> > > order to make stuff link properly at run time these non-standard
> > > locations are added to /etc/ld.so.conf.d.   I'm wondering if there is a
> > > reason not to use this information to add paths to
> > > CMAKE_SYSTEM_LIBRARY_PATH?   It would certainly help in finding
> > > libraries that are installed in diverse places.
> >
> > Sounds like a useful idea IMO.
> > It could be done in UnixPaths.cmake, if /etc/ld.so.conf exists, parse
> > it, get   the directories from it, check for duplicates, and add them to
> > the search   paths.
>
> Sounds indeed sane. But be aware that this file may contain include
> directives with glob expressions, usually something like
> /etc/ld.so.conf.d/*.conf. If you don't follow them you will hardly find
> anything on modern distros.
>
> Eike
>
>
Yeah, the one I'm looking at looks like this:

$ cat ld.so.conf
include /etc/ld.so.conf.d/*.conf
/usr/local/lib

$ for T in ld.so.conf.d/*;do echo $T; cat $T;done
ld.so.conf.d/R-i386.conf
/usr/lib/R/lib
ld.so.conf.d/atlas-i386.conf
/usr/lib/atlas
ld.so.conf.d/cuda-%{arch}.conf
/usr/lib/cuda
ld.so.conf.d/kernel-2.6.35.10-69.fc14.i686.PAE.conf
# Placeholder file, no vDSO hwcap entries used in this kernel.
ld.so.conf.d/kernel-2.6.35.10-72.fc14.i686.PAE.conf
# Placeholder file, no vDSO hwcap entries used in this kernel.
ld.so.conf.d/kernel-2.6.35.10-74.fc14.i686.PAE.conf
# Placeholder file, no vDSO hwcap entries used in this kernel.
ld.so.conf.d/mysql-i386.conf
/usr/lib/mysql
ld.so.conf.d/nvidia-lib.conf
/usr/lib/nvidia
ld.so.conf.d/octave-i386.conf
/usr/lib/octave-3.3.54
ld.so.conf.d/qt-i386.conf
/usr/lib/qt-3.3/lib
ld.so.conf.d/tix-i386.conf
/usr/lib/tcl8.5
ld.so.conf.d/wine-32.conf
/usr/lib/wine/
ld.so.conf.d/xulrunner-32.conf
/usr/lib/xulrunner-1.9.2
ld.so.conf.d/xulrunner2-32.conf
/usr/lib/xulrunner-2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110120/030cc19a/attachment.htm>


More information about the CMake mailing list