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 class="Apple-style-span" color="#6633ff">MESSAGE(STATUS &quot;Looking for IrrKlang...&quot;)</font></div>

<div><font class="Apple-style-span" color="#6633ff"><br></font></div><div><font class="Apple-style-span" color="#6633ff">find_library(IrrKlang_LIBRARIES irrKlang</font></div><div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">                </span>${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc</font></div>

<div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </span>)</font></div><div><font class="Apple-style-span" color="#6633ff"><br></font></div><div><font class="Apple-style-span" color="#6633ff">find_path(IrrKlang_INCLUDE_DIRS irrKlang.h</font></div>

<div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">                </span>${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/include</font></div><div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </span>)</font></div>

<div><font class="Apple-style-span" color="#6633ff"><br></font></div><div><font class="Apple-style-span" color="#6633ff">IF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)</font></div><div><font class="Apple-style-span" color="#6633ff">   SET(IrrKlang_FOUND TRUE)</font></div>

<div><font class="Apple-style-span" color="#6633ff">ENDIF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)</font></div><div><font class="Apple-style-span" color="#6633ff"><br></font></div><div><font class="Apple-style-span" color="#6633ff"><br>

</font></div><div><font class="Apple-style-span" color="#6633ff">IF (IrrKlang_FOUND)</font></div><div><font class="Apple-style-span" color="#6633ff">   IF (NOT IrrKlang_FIND_QUIETLY)</font></div><div><font class="Apple-style-span" color="#6633ff">      MESSAGE(STATUS &quot;Found IrrKlang: ${IrrKlang_LIBRARIES}&quot;)</font></div>

<div><font class="Apple-style-span" color="#6633ff">   ENDIF (NOT IrrKlang_FIND_QUIETLY)</font></div><div><font class="Apple-style-span" color="#6633ff">ELSE (IrrKlang_FOUND)</font></div><div><font class="Apple-style-span" color="#6633ff">   IF (IrrKlang_FIND_REQUIRED)</font></div>

<div><font class="Apple-style-span" color="#6633ff">      MESSAGE(FATAL_ERROR &quot;Could not find IrrKlang&quot;)</font></div><div><font class="Apple-style-span" color="#6633ff">   ENDIF (IrrKlang_FIND_REQUIRED)</font></div>

<div><font class="Apple-style-span" color="#6633ff">ENDIF (IrrKlang_FOUND)</font></div><div><font class="Apple-style-span" color="#6633ff"><br></font></div><div>Everything works fine exept I can&#39;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>

<meta charset="utf-8"><meta charset="utf-8"><div><br></div><div>here is my otool output after building the project </div><div><font class="Apple-style-span" color="#6633ff">$ otool -L ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp </font></div>

<div><font class="Apple-style-span" color="#6633ff">./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp:</font></div><div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </span>@executable_path/../Components/libOgreRTShaderSystem.dylib (compatibility version 0.0.0, current version 1.7.1)</font></div>

<div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </span>@executable_path/../Frameworks/OIS.framework/Versions/A/OIS (compatibility version 1.0.0, current version 1.0.0)</font></div>

<div><span class="Apple-tab-span" style="color: rgb(102, 51, 255); white-space: pre; ">        </span><font class="Apple-style-span" color="#ff0000">/usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current version 1.0.0) --&gt; I want cmake to link that lib, because my lib is not there.</font></div>

<div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)</font></div><div><font class="Apple-style-span" color="#6633ff"><span class="Apple-tab-span" style="white-space:pre">        </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>