Hi,
unfortunately using FIND_LIBRARY does not help. In the minimal example I gave
above I'm now using this CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
PROJECT(test CXX)
SET( CMAKE_FIND_LIBRARY_PREFIXES  "lib" "" )
FIND_LIBRARY(SOME_LIBRARY NAMES mylib PATHS /Users/sarrazin/test )
ADD_EXECUTABLE( myexe helloworld.cpp )
target_link_libraries( myexe ${SOME_LIBRARY} )

Again, this works with make but not with Xcode. It works as soon as I copy
mylib.so to mylib.dylib. However both .so and .dylib are in
CMAKE_FIND_LIBRARY_SUFFIXES and the library mylib.so is found by FIND_LIBRARY,
so I don't understand why this makes any difference. 
I'm using cmake 2.8.12.1 and Xcode 5.0.2.
Cheers,Bjoern

            
  
Original Message processed by David.fx12   Subject: Re: [CMake] Re-2:  .so
libraries and Xcode (03-Mar-2014 22:24)From:    Michael Jackson
<[email protected]>To:      [email protected] That part may
not be correct.



it should be target_link_libraries(myexe somelib)



CMake will look for variations of the name for the library. I think. At least I
have never had to put a full path like at and I use .plugin for my libraries in
my project and they work fine on OS X with Xcode.



You should be using the "find_library()" function to find your library which
gets assigned to a CMake variable. Then you end up with something like this:



 FIND_LIBRARY(SOME_LIBRARY

  NAMES somelib

  PATHS /full/path/to/  )

target_link_libraries(myexe ${SOME_LIBRARY})



That really should work on Xcode without any issues.



Mike J.



On Mar 3, 2014, at 2:18 PM, Bjoern Sarrazin <[email protected]> wrote:



>> I use something like

>> 

>> target_link_libraries(myexe /full/path/to/somelib.so)



      
   
      




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to