Commit 0d3288ca authored by Halla Rempt's avatar Halla Rempt

Set rpaths for OSX

To quote the cmake manual:

"Policy CMP0042 was introduced to change the default value of
MACOSX_RPATH to ON. This is because use of @rpath is a more flexible
and powerful alternative to @executable_path and @loader_path."

And whenever something is flexible and powerful, you can bet there
are too many ways of doing things and that it'll take days or weeks
to get things working again.

This change explicitly sets the rpaths both for running krita on OSX
after doing a make install and for running krita from a bundle. There
may be some redundancy here and it is still not enough. Macdeployqt
doesn't pick up the location of the libraries and start looking in
/Libraries/Frameworks for the Qt frameworks. So either we can add
a #{CMAKE_INSTALL_PREFIX}/lib to the properties here, or fix that in
the deploy script. For now, I'm doing the latter and running
macdeployqt like this:

rm -rf ~/kf5/
rm -rf ~/kf5/krita.dmg
cp -r ~/kf5/i/bin/ ~/kf5
cp -r ~/kf5/i/share ~/kf5/
mkdir -p ~/kf5/
install_name_tool -add_rpath /Users/boudewijnrempt/kf5/i/lib ~/kf5/
macdeployqt ~/kf5/ \
    -verbose=0 \
    -executable=/Users/boudewijnrempt/kf5/ \
    -extra-plugins=/Users/boudewijnrempt/kf5/i/lib/krita/ \
    -extra-plugins=/Users/boudewijnrempt/kf5/i/lib/plugins/ \
mv ~/kf5/*so ~/kf5/
install_name_tool -delete_rpath  @loader_path/../../../../lib ~/kf5/
install_name_tool -delete_rpath  /Users/boudewijnrempt/kf5/i/lib ~/kf5/
parent 4ada36c8
......@@ -186,6 +186,7 @@ if (APPLE)
set_target_properties(krita PROPERTIES INSTALL_RPATH "@loader_path/../../../../lib;@loader_path/../lib;@loader_path/../Frameworks;@executable_path/../lib;@executable_path/../Frameworks")
set_target_properties(krita PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.template)
set_target_properties(krita PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.krita")
set_target_properties(krita PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Krita")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment