[CMake] linking: absolute path vs -l<libname>

Alexander Neundorf a.neundorf-work at gmx.net
Wed Sep 2 16:18:30 EDT 2015


On Wednesday, September 02, 2015 08:22:08 Nico Schlömer wrote:
> > it uses -l if the full path is not know or if the full path is one of the
> > system
> library dirs
> 
> Hm, that sound a little weird. Using `-l` appears to delegate the library
> finding to the linker although CMake has already done that job. If one was
> overly cautious, one could ask questions like: What if there are two
> libraries by the same name in different system library dirs? What if
> there's only one library in a system dir at configure time, but two at link
> time?
> 
> Moreover, in the example I gave above it seems that both libraries are in
> the system path, yet still they are represented differently on the link
> line.

what values do ${ZLIB_LIBRARIES} and ${netCDF_LIBRARIES} have in your case ?

Alex



More information about the CMake mailing list