[CMake] Help Please-Link Library

Bill Hoffman bill.hoffman at kitware.com
Mon Jul 16 21:53:18 EDT 2007


Eric Noulard wrote:
> 2007/7/17, Bill Hoffman <bill.hoffman at kitware.com>:
>> Eric Noulard wrote:
>> >
>> > If your lib is not in the lib search path then you need to add the
>> > appropriate
>> > PATH using the LINK_DIRECTORIES macro
>> >
>> It is much better to add the full path to the library, and use 
>> FIND_LIBRARY.
>
> Much better? Why?
> In order to avoid using another lib from the same place?
>
>
Basically yes, if CMake knows exactly which library you want, it can 
order the -L
directories in such a way that you will get the right ones.   It is also 
better for the user
because they will be able to put the path to the library in the cmake 
cache at configure
time.   Not just a path to a directory, but the full path to where the 
library actually is.

-Bill



More information about the CMake mailing list