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

Rolf Eike Beer eike at sf-mail.de
Thu Jan 20 12:47:42 EST 2011


> 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


More information about the CMake mailing list