[CMake] .so libraries and Xcode

Bjoern Sarrazin bjoern at apoambach.de
Mon Mar 3 12:25:01 EST 2014


                        Hi!
I'm trying to link shared libraries with filename extension ".so"  (like the
ROOT libraries from root.cern.ch). This works fine using Makefiles, also on Mac
OS. Using option -G Xcode however it does not work:
I use something like
target_link_libraries(myexe /full/path/to/somelib.so)
Running cake with -G Xcode prints a warning:
  "Target "myexe" links to item /full/path/to/somelib.so which is a full-path
but not a valid library file name."
When I run the build step in Xcode the linking step fails with ld: library not
found for -lsomelib.so.
What's going wrong here? I have this problem whenever I try to link a shared
library with .so filename extension and option -G Xcode.
 As a work around everything works fine when I use
LINK_DIRECTORIES( /full/path/to )
and add -lsomelib to the link flags of my exe. But this is an annoying
workaround because I'd like to use FIND_LIBRARY to search for the library and
FIND_LIBRARY returns /full/path/to/somelib.so. 
Cheers,Bjorn



                





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140303/9c283ad4/attachment.html>


More information about the CMake mailing list