[CMake] linking to arbitrary libraries in linux.

Alexander Neundorf a.neundorf-work at gmx.net
Thu Feb 28 19:05:29 EST 2008


On Friday 29 February 2008, David Cole wrote:
> On 2/28/08, Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
> > target_link_libraries(targetName /full/path/to/libName.a)
>
> FYI:
>
> The "/full/path/to/" feature was only recently added to CVS CMake. The
> specify lib by a full path technique may not work as you'd expect in CMake
> 2.4.8.... If you want to use full paths in target_link_libraries calls, be
> sure to use CVS CMake.

No, just the behaviour has been changed, to make sure always the right library 
is used if there are multiple libs (versions) with the same name.
Using target_link_libraries(hello /my/custom/path/libfoo.so) is working since 
I think very early cmake versions (that's also what find_library() returns)

Alex


More information about the CMake mailing list