<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
</head>
<body style='FONT:10pt Courier New;COLOR:#000000;background:;'><table style="Z-INDEX: 2; BORDER-BOTTOM: #c0c0c0 1px solid; POSITION: static; BORDER-LEFT: #c0c0c0 1px solid; BACKGROUND-COLOR: #ffffff; MARGIN-TOP: 17px; WIDTH: 500px; FONT-FAMILY: Tahoma,Arial; HEIGHT: 66px; MARGIN-LEFT: 12px;     FONT-SIZE: 10pt; BORDER-TOP: #c0c0c0 1px solid; BORDER-RIGHT: #c0c0c0 1px solid; text-align: left;">    <tbody>        <tr>            <td style="padding: 7px 6px 6px 8px; margin: 0px 0px 0px 0px; border: 0px none; line-height: 130%;      VERTICAL-ALIGN: top; width: 100%;" id="" creatediv="true"><div id="TABLEDIV">Hi,</div><div id="TABLEDIV"><br></div><div id="TABLEDIV">unfortunately using FIND_LIBRARY does not help. In the minimal example I gave above I'm now using this CMakeLists.txt:</div><div id="TABLEDIV"><br></div><div id="TABLEDIV"><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">PROJECT(test CXX)</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">SET( CMAKE_FIND_LIBRARY_PREFIXES  "lib" "" )</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">FIND_LIBRARY(SOME_LIBRARY NAMES mylib PATHS /Users/sarrazin/test )</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">ADD_EXECUTABLE( myexe helloworld.cpp )</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">target_link_libraries( myexe ${SOME_LIBRARY} )</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">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. </p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">I'm using cmake 2.8.12.1 and Xcode 5.0.2.</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">Cheers,</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">Bjoern</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p></div></td><td style="width: 0%; padding: 0px 0px 0px 0px;"><br></td>        </tr>    </tbody></table><br>  <br><blockquote style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><table style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; FONT: 10pt Arial; COLOR: black; BORDER-TOP: #c0c0c0 1px solid; BORDER-RIGHT: 0px" id="tobit_repfor" border="0" cellspacing="0" cellpadding="0" width="99%" cols="3"><tbody><tr bordercolorlight="#ffffff" bordercolor="#ffffff" bgcolor="#ffffff"><td style="BORDER-BOTTOM: 0px; PADDING-BOTTOM: 1px; PADDING-LEFT: 4px; PADDING-TOP: 1px" height="22" colspan="2"><div style="FONT: bold 9pt Arial">Original Message processed by David.fx12  </div></td><td style="BORDER-BOTTOM: 0px" align="right"><div style="FONT: 8pt Arial"><div style="FONT: 8pt Arial"><strong><font color="#808080"></font></strong> </div></div></td></tr></tbody></table><table id="tobit_repfor2" style="BORDER-RIGHT: #e0e0e0 1px solid; BORDER-TOP: 0px; FONT: 8pt Tahoma; BORDER-LEFT: #e0e0e0 1px solid; COLOR: black; BORDER-BOTTOM: #e0e0e0 1px solid" cellspacing="0" cols="2" cellpadding="0" width="99%" border="0"><tbody><tr style="PADDING-BOTTOM: 2px"><td style="PADDING-LEFT: 6px; BORDER-BOTTOM: #ffffff 1px solid" width="68" bgcolor="#efefef" height="18"><div style="FONT: 8pt Tahoma">Subject: </div></td><td style="PADDING-LEFT: 4px; BORDER-BOTTOM: #efefef 1px solid" bgcolor="#ffffff"><div style="FONT: 8pt Tahoma">Re: [CMake] Re-2:  .so libraries and Xcode (03-Mar-2014 22:24)</div></td></tr><tr style="PADDING-BOTTOM: 2px"><td style="PADDING-LEFT: 6px; BORDER-BOTTOM: #ffffff 1px solid" width="68" bgcolor="#efefef" height="18"><div style="FONT: 8pt Tahoma">From:    </div></td><td style="PADDING-LEFT: 4px; BORDER-BOTTOM: #efefef 1px solid" bgcolor="#ffffff"><div style="FONT: 8pt Tahoma"><a href="mailto:mike.jackson@bluequartz.net">Michael Jackson <mike.jackson@bluequartz.net></a></div></td></tr><tr style="PADDING-BOTTOM: 0px"><td style="PADDING-LEFT: 6px" width="68" bgcolor="#efefef" height="17"><div style="FONT: 8pt Tahoma">To:      </div></td><td style="PADDING-LEFT: 4px" bgcolor="#ffffff"><div style="FONT: 8pt Tahoma"><a href="mailto:bjoern@apoambach.de">bjoern@apoambach.de</a></div></td></tr></tbody></table><div> </div><div><style>
   html, body, textarea{
   scrollbar-face-color: #E8E8E8;
   scrollbar-highlight-color: #BEBEBE;
   scrollbar-3dlight-color: #FFFFFF;
   scrollbar-darkshadow-color: #FFFFFF;
   scrollbar-shadow-color: #BEBEBE;
   scrollbar-arrow-color: #BEBEBE;
   scrollbar-track-color: #F7F7F7;
   }
</style>That part may not be correct.
<br>
<br>it should be target_link_libraries(myexe somelib)
<br>
<br>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.
<br>
<br>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:
<br>
<br> FIND_LIBRARY(SOME_LIBRARY
<br>  NAMES somelib
<br>  PATHS /full/path/to/  )
<br>target_link_libraries(myexe ${SOME_LIBRARY})
<br>
<br>That really should work on Xcode without any issues.
<br>
<br>Mike J.
<br>
<br>On Mar 3, 2014, at 2:18 PM, Bjoern Sarrazin <bjoern@apoambach.de> wrote:
<br>
<br>>> I use something like
<br>>> 
<br>>> target_link_libraries(myexe /full/path/to/somelib.so)
<br>
<br>      
   
      </div></blockquote><div style='FONT:10pt Courier New'></DIV><div style='FONT:10pt Courier New'></DIV></body></html>