The issue is not about finding the library at built time, event if my library is found in ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc 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.
I want to find a way to tell the linker to link the library from where it find it. Does it make sense ? On Sun, Sep 18, 2011 at 4:29 PM, Cristobal Navarro <axisch...@gmail.com>wrote: > yes > > you have to provide another option > find_library( IrrKlang_LIBRARIES irrKlang PATHS <path1 to library> <path2 > to library> ... ) > > http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library > > is this what you need? > best regards > Cristobal > > > On Sun, Sep 18, 2011 at 10:16 AM, amine bezzarga <abezz...@gmail.com>wrote: > >> Hello guys, >> >> I added a sound library to my project, So I first created a cmake module >> to find it >> >> MESSAGE(STATUS "Looking for IrrKlang...") >> >> find_library(IrrKlang_LIBRARIES irrKlang >> >> ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc >> ) >> >> find_path(IrrKlang_INCLUDE_DIRS irrKlang.h >> ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/include >> ) >> >> IF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES) >> SET(IrrKlang_FOUND TRUE) >> ENDIF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES) >> >> >> IF (IrrKlang_FOUND) >> IF (NOT IrrKlang_FIND_QUIETLY) >> MESSAGE(STATUS "Found IrrKlang: ${IrrKlang_LIBRARIES}") >> ENDIF (NOT IrrKlang_FIND_QUIETLY) >> ELSE (IrrKlang_FOUND) >> IF (IrrKlang_FIND_REQUIRED) >> MESSAGE(FATAL_ERROR "Could not find IrrKlang") >> ENDIF (IrrKlang_FIND_REQUIRED) >> ENDIF (IrrKlang_FOUND) >> >> Everything works fine exept I can't control from where the library is >> linked. >> Why after I build my project OSX is looking for that library in >> /usr/local/lib ? >> 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 >> ? >> >> here is my otool output after building the project >> $ otool -L ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp >> ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp: >> @executable_path/../Frameworks/Ogre.framework/Versions/1.7.1/Ogre >> (compatibility version 0.0.0, current version 1.7.1) >> @executable_path/../Components/libOgreRTShaderSystem.dylib >> (compatibility version 0.0.0, current version 1.7.1) >> @executable_path/../Frameworks/OIS.framework/Versions/A/OIS >> (compatibility version 1.0.0, current version 1.0.0) >> /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. >> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version >> 7.9.0) >> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version >> 123.0.0) >> >> 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. >> >> Do you have any ideas ? >> Mino >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.cmake.org/mailman/listinfo/cmake >> >
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake