Failing to macdeployqt
-
Qt 6.8.0 on macOS Sequoia, application built OK and then:
[226/227] Linking CXX executable DeepSkyStacker/DeepSkyStacker.app/Contents/MacOS/DeepSkyStacker ld: warning: ignoring duplicate libraries: 'vcpkg_installed/arm64-osx/debug/lib/libjpeg.a' [226/227] Install the project... -- Install configuration: "Debug" -- Running Qt deploy tool for DeepSkyStacker.app in working directory '/Users/amonra/.vs/DSS/arm64/Darwin/Debug' '/opt/Qt/6.8.0/macos/bin/macdeployqt' 'DeepSkyStacker.app' '-appstore-compliant' '-always-overwrite' '--hardened-runtime' CMake Error at /opt/Qt/6.8.0/macos/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:535 (message): Executing /opt/Qt/6.8.0/macos/bin/macdeployqt failed: no such file or directory Call Stack (most recent call first): /opt/Qt/6.8.0/macos/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:543 (qt6_deploy_runtime_dependencies) .qt/deploy_DeepSkyStacker_0e78a3b7ab.cmake:5 (qt_deploy_runtime_dependencies) DeepSkyStacker/cmake_install.cmake:41 (include) cmake_install.cmake:52 (include) FAILED: CMakeFiles/install.util cd /Users/amonra/.vs/DSS/out/build && /Applications/CMake.app/Contents/bin/cmake -P cmake_install.cmake ninja: build stopped: subcommand failed.
if(NOT LINUX) set (deploy_tool_options_arg "") if(APPLE) set(deploy_tool_options_arg "${deploy_tool_options_arg} --hardened-runtime") elseif(WIN32) set(deploy_tool_options_arg "${deploy_tool_options_arg} --pdb") endif() # Generate a deployment script to be executed at install time # App bundles on macOS have an .app suffix if(APPLE) set(executable_path "$<TARGET_FILE_NAME:DeepSkyStacker>.app") else() message ("Target filename:" $<TARGET_FILE_NAME:DeepSkyStacker>) set(executable_path "${CMAKE_INSTALL_BINDIR}/$<TARGET_FILE_NAME:DeepSkyStacker>") endif() message ("executable_path: " ${executable_path}) message ("deploy tools options arg: " ${deploy_tool_options_arg}) qt_generate_deploy_script( TARGET DeepSkyStacker OUTPUT_SCRIPT deploy_script CONTENT " qt_deploy_runtime_dependencies( EXECUTABLE \"${executable_path}\" DEPLOY_TOOL_OPTIONS ${deploy_tool_options_arg} )" ) else() qt_generate_deploy_app_script( TARGET ${PROJECT_NAME} OUTPUT_SCRIPT deploy_script DEPLOY_TOOL_OPTIONS ${deploy_tool_options_arg} ) endif() install (SCRIPT ${deploy_script}) install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION .)
What information do you want to determine what I've missed or done wrong?
Thanks, David
-
Hi,
Looks like your are not setting the executable path correctly in the Apple case. You are just giving the bundle name rather than the path to the bundle.
-
Hmmm, I think I'm now more deeply confused than I was :(
Lets say I want to create an installable "thing" for macOS that contains 3 executables. A, B and C. I guess that's a bundle (or a .dmg containing a bundle?).
My top level directory has a CMakeLists.txt and three sub-dirs A, B and C each of which has their own CMakeLists.txt
In which CMakeLists.txt file (or files) do I place the deployment stuff I showed above? Is there a commented example that I could look at in the hope that this will clear stuff up for me. Clearly I've not got my head round how this works.
In the meantime what changes should I make to the deployment code I posted above to get it to work (with explanations please to ensure that I understand what needs to be done and why).
Thanks
D. -
Did you already read the macOS deployment documentation ?
It does not cover your exact use case (multiple executable in a single bundle) but it should give you already a basic understanding of the process.
-
Well, an app is just one single program. Internally, the "app" is just a folder ending in .app. Inside it you'll find
Contents/MacOS
and that is where the single executable is located which is launched when opening the app (e.g. double clicking on the folder). If you have additional command line programs those usually are not apps (you'd have to typeopen mytool
instead of./mytool
to run the command on the command line). If these are just called from the main app you can hide them inside the app folder (maybeContents/Resources
or createContents/bin
). Otherwise, Apple also has installer packages (.pkg) which extract several items (instead of just a single app folder) to their appropriate places. There would be an appropriate place for command line tools and thePATH
environment variable should also be adapted to make them visible. But, I don't know how to create.pkg
s.If you truly have multiple GUI programs, these should actually be separate apps.