On 5/24/14, [email protected] <[email protected]> wrote: > > > ----- Original Message ----- >> I have a bunch of libraries and frameworks that properly use @rpath. >> Now I am trying to build an application that uses those library and >> frameworks via CMake. >> >> From this blog: >> http://www.kitware.com/blog/home/post/510 >> I see I am supposed to do: >> set(CMAKE_MACOSX_RPATH 1) > > The above should be set before declaring an @rpath target, which is one that > has an install name with @rpath.
Okay, the ordering was one thing I screwed up. That was a major reason it didn't work for me. > > Setting CMAKE_BUILD_WITH_INSTALL_RPATH should have an effect, if set before > any targets that link with the @rpath libraries. > Can you provide an example of what you are doing, so we can find out why its > not working for you? That was my ordering screw up. It's working now. > I understand drag-and-drop, but it doesn't work for my situations. I have > several 3rd party libraries that are not in system locations, and are not > part of the build tree, so setting CMAKE_BUILD_WITH_INSTALL_RPATH breaks my > builds. Install time is where I get a complete .app bundle. So 3rd party libraries should be bundled in the .app. This avoids that problem. Notice that a real/native Xcode project always does this copy phase. I have this working for my stuff now with CMake using some aggressive code I wrote. (Similar to the Visual Studio thread I was in.) > With a list. > set_target_properties(bar PROPERTIES INSTALL_RPATH > "@loader_path/../Frameworks;@loader_path/../lib") Didn't think of that. Thanks that worked. >> >> 3) What is the common way people copy their frameworks into their .app >> bundle now-a-days? > > I do it at install time by setting the install destination to be inside the > .app bundle. Incidentally, I found BundleUtilities/fix_up_bundle, but it seems to break if you use @rpath. It doesn't seem to do build time, but install time, which is another problem for me. Thanks, Eric -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
