On Wed, May 21, 2008 at 8:45 AM, Steven Van Ingelgem <<a href="mailto:steven@vaningelgem.be">steven@vaningelgem.be</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a question about how to link (via CMake) to specific .so's.<br>
<br>
I know I need to use target_link_libraries. But what happens then is<br>
that the so is linked against the directory where it's in.<br>
Is there a possibility (i know rpath does exist, but I don't know<br>
exactly how to use it) to have the .so's loaded from the local<br>
directory before it starts looking in the default library directories?</blockquote><div><br>Steven,<br><br>Read the documentation for the find_library() command
the output of which you should use in target_link_libraries(). Take
note of the CMAKE_LIBRARY_PATH and CMAKE_PREFIX_PATH (2.6.0) options.
Using these it should be possible to make CMake find libraries in paths
you desire before it checks the default system paths. You can also use
NO_DEFAULT_PATH and specify the paths directly to the find_library()
command.<br>
<br><a href="http://www.cmake.org/HTML/Documentation.html" target="_blank">http://www.cmake.org/HTML/Documentation.html</a><br><br></div></div>-- <br>Philip Lowman