<html><body bgcolor="#FFFFFF"><div>My guess is that the audio library has an install path of /usr/local/lib encoded in it. Try posting tue output of otool for the actual audio library. <br><br><div>-----</div><div>Mike Jackson <a href="http://www.bluequartz.net"><a href="http://www.bluequartz.net">www.bluequartz.net</a></a></div>
<div>Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net"><a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a></a></div><div>BlueQuartz Software Dayton, Ohio</div>
<div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">Sent from my mobile device. </span></div>
</div><div><br>On Sep 18, 2011, at 23:38, Cristobal Navarro <<a href="mailto:axischire@gmail.com">axischire@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>ok i get your point.<div>mmm. In others words you need something equivalent to rpath command, im pretty sure cmake can handle this easily let me know if the following helps.</div>
<div><br></div><div>have you tried adding more options to the find_library command ??</div>
<div>for example have you tried this (also, with the PATHS command just to be sure):</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><div>
<font color="#6633ff">find_library(IrrKlang_LIBRARIES irrKlang</font></div><div><font color="#6633ff"><span style="white-space: pre-wrap; ">                PATHS </span>${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc</font></div>
</span><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; line-height: 22px; white-space: pre; background-color: rgb(255, 255, 255); "> NO_DEFAULT_PATH</span><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; "><div style="background-color: rgb(255, 255, 255); ">
<font color="#6633ff"><span style="white-space: pre-wrap; ">        </span>)</font></div><div style="background-color: rgb(255, 255, 255); "><font color="#6633ff"><br></font></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">And what is your "target_link_libraries" command?</span></div>
</span></div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Sun, Sep 18, 2011 at 12:33 PM, amine bezzarga <span dir="ltr"><<a href="mailto:abezzarg@gmail.com"><a href="mailto:abezzarg@gmail.com">abezzarg@gmail.com</a></a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The issue is not about finding the library at built time, event if my library is found in <span style="border-collapse:collapse;color:rgb(102, 51, 255);font-family:arial, sans-serif;font-size:13px">${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc</span> and after building is done, my app is still looking for the library in /usr/local/lib at runtime as you can see with the otools output in my first message.<div>
<br></div><div>I want to find a way to tell the linker to link the library from where it find it.</div><div>Does it make sense ?</div><div><div></div><div class="h5"><div></div><br><div class="gmail_quote">On Sun, Sep 18, 2011 at 4:29 PM, Cristobal Navarro <span dir="ltr"><<a href="mailto:axischire@gmail.com" target="_blank"><a href="mailto:axischire@gmail.com">axischire@gmail.com</a></a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">yes<div><br></div><div>you have to provide another option</div><div>find_library( <span style="color:rgb(102, 51, 255)">IrrKlang_LIBRARIES irrKlang </span>PATHS <path1 to library> <path2 to library> ... )</div>
<div><br></div><div><a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library" target="_blank"><a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library">http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library</a></a></div>
<div><br></div><div>
is this what you need?</div>
<div>best regards</div><div>Cristobal</div><div><br></div><div><br><div class="gmail_quote"><div><div></div><div>On Sun, Sep 18, 2011 at 10:16 AM, amine bezzarga <span dir="ltr"><<a href="mailto:abezzarg@gmail.com" target="_blank"><a href="mailto:abezzarg@gmail.com">abezzarg@gmail.com</a></a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>Hello guys,<div><br></div><div>I added a sound library to my project, So I first created a cmake module to find it</div>
<div><br></div><div><div><font color="#6633ff">MESSAGE(STATUS "Looking for IrrKlang...")</font></div>
<div><font color="#6633ff"><br></font></div><div><font color="#6633ff">find_library(IrrKlang_LIBRARIES irrKlang</font></div><div><font color="#6633ff"><span style="white-space:pre-wrap">                </span>${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc</font></div>
<div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>)</font></div><div><font color="#6633ff"><br></font></div><div><font color="#6633ff">find_path(IrrKlang_INCLUDE_DIRS irrKlang.h</font></div>
<div><font color="#6633ff"><span style="white-space:pre-wrap">                </span>${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/include</font></div><div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>)</font></div>
<div><font color="#6633ff"><br></font></div><div><font color="#6633ff">IF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)</font></div><div><font color="#6633ff"> SET(IrrKlang_FOUND TRUE)</font></div>
<div><font color="#6633ff">ENDIF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)</font></div><div><font color="#6633ff"><br></font></div><div><font color="#6633ff"><br>
</font></div><div><font color="#6633ff">IF (IrrKlang_FOUND)</font></div><div><font color="#6633ff"> IF (NOT IrrKlang_FIND_QUIETLY)</font></div><div><font color="#6633ff"> MESSAGE(STATUS "Found IrrKlang: ${IrrKlang_LIBRARIES}")</font></div>
<div><font color="#6633ff"> ENDIF (NOT IrrKlang_FIND_QUIETLY)</font></div><div><font color="#6633ff">ELSE (IrrKlang_FOUND)</font></div><div><font color="#6633ff"> IF (IrrKlang_FIND_REQUIRED)</font></div>
<div><font color="#6633ff"> MESSAGE(FATAL_ERROR "Could not find IrrKlang")</font></div><div><font color="#6633ff"> ENDIF (IrrKlang_FIND_REQUIRED)</font></div>
<div><font color="#6633ff">ENDIF (IrrKlang_FOUND)</font></div><div><font color="#6633ff"><br></font></div><div>Everything works fine exept I can't control from where the library is linked.</div>
<div>Why after I build my project OSX is looking for that library in /usr/local/lib ?</div><div>Is there a way to tell cmake to link the library from where it find it i.e ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc ?</div>
<div><br></div><div>here is my otool output after building the project </div><div><font color="#6633ff">$ otool -L ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp </font></div>
<div><font color="#6633ff">./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp:</font></div><div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>@executable_path/../Frameworks/Ogre.framework/Versions/1.7.1/Ogre (compatibility version 0.0.0, current version 1.7.1)</font></div>
<div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>@executable_path/../Components/libOgreRTShaderSystem.dylib (compatibility version 0.0.0, current version 1.7.1)</font></div>
<div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>@executable_path/../Frameworks/OIS.framework/Versions/A/OIS (compatibility version 1.0.0, current version 1.0.0)</font></div>
<div><span style="color:rgb(102, 51, 255);white-space:pre-wrap">        </span><font color="#ff0000">/usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current version 1.0.0) --> I want cmake to link that lib, because my lib is not there.</font></div>
<div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)</font></div><div><font color="#6633ff"><span style="white-space:pre-wrap">        </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)</font></div>
<div><br></div><div>I know I can correct the path with bundleutilities, but the library still need to be copied in /usr/local/lib to be preccessed by bundleutilitities in that case. </div><div><br></div><div>Do you have any ideas ?</div>
<div>Mino</div><br>
</div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank"><a href="http://www.kitware.com">www.kitware.com</a></a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"><a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a></a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank"><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></a><br></blockquote></div></div></blockquote></div>
<br><div><div>
</div></div><div><font color="#C0C0C0"><br></font></div><br>
</div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Powered by <a href="http://www.kitware.com"><a href="http://www.kitware.com">www.kitware.com</a></a></span><br>
<span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></a></span><br>
<span></span><br><span>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ"><a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a></a></span><br>
<span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br><span><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></span></div></blockquote></body></html>