You need to copy the library into the .app bundle at 
MeshVisualization.app/Contents/Libraries/.

Your "add_executable()" command should have the "MACOSX_BUNDLE" set in. See the 
help listing for the add executable.
___________________________________________________________
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       [email protected] 
BlueQuartz Software               Dayton, Ohio

On Aug 31, 2011, at 9:04 AM, Yifei Li wrote:

> Hi all,
> 
> My app MeshVisualization uses a library called OpenMesh. I had a runtime 
> error when running the app: 
> dyld: Library not loaded: 
> @executable_path/../Libraries/libOpenMeshCore.2.0.dylib
>   Referenced from: 
> /Users/yifli/Documents/MeshVisualization/build/Build/bin/MeshVisualization
>   Reason: image not found
> 
> 
> My FindOpenMesh.cmake does find the library and defines 
> OPENMESH_LIBRARY:  OpenMeshCore
> OPENMESH_LIBRARY_DIR: /usr/local/lib/OpenMesh
> 
> However, I noticed from compiling details:
> ld: warning: directory not found for option '-L/usr/local/lib/OpenMesh/Debug'
> 
> So how should I solve the runtime problem? Thanks
> 
> 
> Yifei
> 
> _______________________________________________
> 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

Reply via email to