macdeployqt release/DuckCapture.app
declare DUCKLIB=libDuckCore.1.dylib
declare DUCKAPP=release/DuckCapture.app
mkdir -p $DUCKAPP/Contents/Frameworks
cp release/$DUCKLIB $DUCKAPP/Contents/Frameworks/$DUCKLIB
install_name_tool -id @executable_path/../Frameworks/$DUCKLIB $DUCKAPP/Contents/Frameworks/$DUCKLIB
install_name_tool -change $DUCKLIB @executable_path/../Frameworks/$DUCKLIB $DUCKAPP/Contents/MacOS/DuckCapture
The main approach is to use the tool "install_name_tool" for dylib, and you'd better to pay more attention to path. It's easy to make mistakes on path in this script.
In addition for releasing, there is another issue for debugging applications with xcode. You can open a console, and run commands below:
export DYLD_PRINT_LIBRARIES=1
open xcode
You'll get some clues when dylib is missing.
No comments:
Post a Comment