[CMake] LD_LIBRARY_PATH not used by the linker

Roger Leigh rleigh at codelibre.net
Thu Aug 2 15:56:02 EDT 2018


It's the quick and easy way to do it.

However, I'd suggest looking at getting CMake to use the proper path 
without it.  Can you use any module-specific variables like 
PYTHON_LIBRARY to override the search.  Or even just add to 
CMAKE_PREFIX_PATH.  (Does VTK support imported targets?)

Regards,
Roger

On 02/08/18 20:43, Ruben Di Battista wrote:
> Hi Roger,
> so I explicitly passing the LDFLAGS is the way to go?
> 
> On Thu, Aug 2, 2018 at 9:41 PM Roger Leigh <rleigh at codelibre.net 
> <mailto:rleigh at codelibre.net>> wrote:
> 
>     On 02/08/18 20:03, Ruben Di Battista wrote:
> 
>      > I'm running cmake on a system where I have module-loaded software
>     such
>      > that `LD_LIBRARY_PATH` gets populated by the module (actually I'm
>     using
>      > Lmod) function.
> 
>     LD_LIBRARY_PATH is used by the *runtime* linker, ld.so.  It is not used
>     when linking at *build* time, with ld.


More information about the CMake mailing list