[CMake] Mac @loader_path for @rpath questions
Eric Wing
ewmailing at gmail.com
Fri May 23 19:14:51 EDT 2014
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)
set_target_properties(bar PROPERTIES INSTALL_RPATH "@loader_path/../lib")
So now, I am trying to improve my user experience with this. So a
couple of questions:
1) I noticed it only applies the @loader_path stuff when I "install"
with CMake. I would like this applied during build because "install"
is very unnatural on Mac where drag-and-drop is king. I was expecting
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) to help, but it doesn't seem
to have an affect.
2) I have both .dylibs and .frameworks. It is customary to bundle
frameworks in .app/Contents/Frameworks/ and somewhat customary to
bundle .dylibs in ./app/Contents/lib
This means I need to specify multiple "Runtime Search Path"
(LD_RUNPATH_SEARCH_PATHS) which Apple/Xcode fully allows, i.e. I need
both:
set_target_properties(bar PROPERTIES INSTALL_RPATH "@loader_path/../Frameworks")
set_target_properties(bar PROPERTIES INSTALL_RPATH "@loader_path/../lib")
How do I declare this for CMake?
3) What is the common way people copy their frameworks into their .app
bundle now-a-days? I was hoping I could get away with:
SET_SOURCE_FILES_PROPERTIES(
${MY_LIBRARIES}
PROPERTIES
MACOSX_PACKAGE_LOCATION Frameworks
)
But CMake just creates an empty directory like:
.app/Contents/Frameworks/ALmixer.framework
with none of the stuff inside the framework. (It doesn't recursively
copy the directory.)
Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
More information about the CMake
mailing list