Yes I think I get it, I tried that but it doesn't work either:<div><div>install_name_tool -change /usr/local/lib/libirrklang.dylib ./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/ ./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib </div>
<div><br></div><div>Can you tell me, what can I do to fix the problem ?</div><br><div class="gmail_quote">On Tue, Sep 20, 2011 at 2:19 AM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#FFFFFF"><div>Yes. Who ever built the irrklang library has set an "install_name" of /usr/local/lib on that library. So it does not matter where the library is located. OS X thinks it is in /usr/local/lib. </div>
<div> You need to fix how that library is compiled and linked. Does that make it clear what is going on?<div class="im"><br><br><div>-----</div><div>Mike Jackson <a href="http://www.bluequartz.net" target="_blank"></a><a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a></div>
<div>Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net" target="_blank"></a><a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a></div><div>BlueQuartz Software Dayton, Ohio</div>
<div><span>Sent from my mobile device. </span></div>
</div></div><div><div></div><div class="h5"><div><br>On Sep 19, 2011, at 19:56, amine bezzarga <<a href="mailto:abezzarg@gmail.com" target="_blank">abezzarg@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite">
<div>Yeah, I tried the NO_DEFAULT_PATH option but without success.<div>
My target_link_library command look like this:</div><div><div><br></div><div>target_link_libraries(${CMAKE_PROJECT_NAME} ${OGRE_LIBRARIES} ${OGRE_PLUGIN_LIBRARIES} ${Boost_LIBRARIES} ${OIS_LIBRARIES} ${IrrKlang_LIBRARIES})</div>
<div><br></div><div>Here is the otool output of the sound library:</div><div><div>$ otool -L ./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib </div><div>./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib (architecture ppc):</div>
<div><span style="white-space:pre-wrap">        </span>/usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div><span style="white-space:pre-wrap">        </span>/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)</div>
<div><span style="white-space:pre-wrap">        </span>/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)</div><div><span style="white-space:pre-wrap">        </span>/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)</div>
<div><span style="white-space:pre-wrap">        </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)</div><div>./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib (architecture i386):</div>
<div><span style="white-space:pre-wrap">        </span>/usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div><span style="white-space:pre-wrap">        </span>/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)</div>
<div><span style="white-space:pre-wrap">        </span>/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)</div><div><span style="white-space:pre-wrap">        </span>/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)</div>
<div><span style="white-space:pre-wrap">        </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)</div></div><div><br></div><div>Does it help ?</div><div><br></div><br><div class="gmail_quote">
On Mon, Sep 19, 2011 at 1:56 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank"></a><a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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" target="_blank"></a><a href="http://www.bluequartz.net" target="_blank"></a><a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a></div>
<div>Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net" target="_blank"></a><a href="mailto:mike.jackson@bluequartz.net" target="_blank"></a><a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a></div>
<div>BlueQuartz Software Dayton, Ohio</div>
<div><span>Sent from my mobile device. </span></div>
</div><div><div></div><div><div><br>On Sep 18, 2011, at 23:38, Cristobal Navarro <<a href="mailto:axischire@gmail.com" target="_blank"></a><a href="mailto:axischire@gmail.com" target="_blank">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 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 style="font-family:monospace;font-size:11px;line-height:22px;white-space:pre-wrap;background-color:rgb(255, 255, 255)"> NO_DEFAULT_PATH</span><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 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" target="_blank"></a><a href="mailto:abezzarg@gmail.com" target="_blank"></a><a href="mailto:abezzarg@gmail.com" target="_blank">abezzarg@gmail.com</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><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><a href="mailto:axischire@gmail.com" target="_blank"></a><a href="mailto:axischire@gmail.com" target="_blank">axischire@gmail.com</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><a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library" target="_blank"></a><a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library" target="_blank">http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library</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><a href="mailto:abezzarg@gmail.com" target="_blank"></a><a href="mailto:abezzarg@gmail.com" target="_blank">abezzarg@gmail.com</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><a href="http://www.kitware.com" target="_blank"></a><a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank"></a><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"></a><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</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><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"></a><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank"></a><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank"></a><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</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" target="_blank"></a><a href="http://www.kitware.com" target="_blank"></a><a href="http://www.kitware.com" target="_blank">www.kitware.com</a></span><br>
<span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank"></a><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"></a><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</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" target="_blank"></a><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"></a><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</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" target="_blank"></a><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a></span></div>
</blockquote>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="font-size:9pt;line-height:115%;font-family:Verdana"><font color="#BFBFBF">Amine Bezzarga • <a href="tel:%2B33%206%2064%2089%2087%2079" value="+33664898779" target="_blank">+33 6 64 89 87 79</a> •
</font><a href="mailto:abezzarg@gmail.com" target="_blank"><font color="#C0C0C0">abezzarg@gmail.com</font></a><font color="#BFBFBF"> • </font><a href="http://goog_1766391406" target="_blank"><font color="#C0C0C0">www.gomino.info</font></a></span><font color="#C0C0C0"><a href="http://gomino.info" target="_blank"> </a></font><div>
</div></div><div><font color="#C0C0C0"><br></font></div><br>
</div>
</div></blockquote></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="font-size:9pt;line-height:115%;font-family:Verdana"><font color="#BFBFBF">Amine Bezzarga • +33 6 64 89 87 79 •
</font><a href="mailto:abezzarg@gmail.com" target="_blank"><font color="#C0C0C0">abezzarg@gmail.com</font></a><font color="#BFBFBF"> • </font><a href="http://goog_1766391406" target="_blank"><font color="#C0C0C0">www.gomino.info</font></a></span><font color="#C0C0C0"><a href="http://gomino.info" target="_blank"> </a></font><div>
</div></div><div><font color="#C0C0C0"><br></font></div><br>
</div>