macdeployqt: How to include extra libraries
-
Based on my other thread about TLS intialization failure, the only way to seemingly get a macOS .app package that will initialize OpenSSL and TLS correctly is to use macdeployqt. Problem with that is our application has it's own plugins that also need to be fixed up with proper "rpath" and dependent libraries copied into the application bundle? This seems like a fairly normal use case to NOT have included in macdeployqt? Or am I missing something?
The CMake BundleUtilities that we have been using for the last 10 years does something to the app package that does not allow it to properly initialize OpenSSL and initialize TLS for an HTTPS connection.
-
Hi,
Which version of macOS are you using to build your application ?
Just to ensure that we are looking at the same thing, can you provide a minimal compilable project that triggers this ?
-
I build on MacOS 13 and 14 (latest of each) using the latest Xcode for each of those respective systems. Here is the help for macdeployqt. I'm using Qt 6.6, 6.7 and 6.8 for testing.
The logic inside of macdeployqt (and the others for the other operating systems) starts with the executable inside the .app package which it draws is dependencies from. Adds in some bits for Qt's own plugins (based on which Qt libraries the executable is linked to. That leaves your own custom plugins out-in-the-cold.
1085:[mjackson@octane:packaging]% /Users/Shared/NX_SDK/Qt/6.7.3/macos/bin/macdeployqt --help Usage: macdeployqt app-bundle [options] Options: -verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug -no-plugins : Skip plugin deployment -dmg : Create a .dmg disk image -no-strip : Don't run 'strip' on the binaries -use-debug-libs : Deploy with debug versions of frameworks and plugins (implies -no-strip) -executable=<path> : Let the given executable use the deployed frameworks too -qmldir=<path> : Scan for QML imports in the given path -qmlimport=<path> : Add the given path to the QML module search locations -always-overwrite : Copy files even if the target file exists -codesign=<ident> : Run codesign with the given identity on all executables -hardened-runtime : Enable Hardened Runtime when code signing -timestamp : Include a secure timestamp when code signing (requires internet connection) -sign-for-notarization=<ident>: Activate the necessary options for notarization (requires internet connection) -appstore-compliant : Skip deployment of components that use private API -libpath=<path> : Add the given path to the library search path -fs=<filesystem> : Set the filesystem used for the .dmg disk image (defaults to HFS+) macdeployqt takes an application bundle as input and makes it self-contained by copying in the Qt frameworks and plugins that the application uses. Plugins related to a framework are copied in with the framework. The accessibility, image formats, and text codec plugins are always copied, unless "-no-plugins" is specified. Qt plugins may use private API and will cause the app to be rejected from the Mac App store. MacDeployQt will print a warning when known incompatible plugins are deployed. Use -appstore-compliant to skip these plugins. Currently two SQL plugins are known to be incompatible: qsqlodbc and qsqlpsql. See the "Deploying Applications on OS X" topic in the documentation for more information about deployment on OS X.