Qt cmake deployment API and Cpack not working for macos
-
Hello everyone,
I am trying to use Qt cmake deployment API, cpack and the IFW from CMake but have problems for Macos bundles.
It seems that cpackIFW runs internally the macdeploy tool and this one fails to find app bundle.
If I runcmake --install .
there is no error because it is runningmacdeploy
fromCMAKEINSTALLPREFIX
but when executingcpack -B package -G "IFW;TGZ" --config CPackConfig.cmake
it fails to find the app bundle.
The cmake I use is here.
Any help will be much appreciated. -
@Mesrine
When running cpack in verbose mode it returns :CPack Verbose: Running Qt deploy tool for QVaultCli.app in working directory '/Users/runner/work/_temp/build/package/_CPack_Packages/Darwin/IFW/QtVault-v0.1.2+gbed06b0.20240325092904-Darwin_21.6.0-x86_64-AppleClang/packages/vaultCli/data'
this comes from here
So it seems
QT_DEPLOY_PREFIX
=CMAKE_INSTALL_PREFIX
the latter is set by cpack.
I can see that the bundle is installed but in theUnspecified
component.CPack Verbose: Installing: /Users/runner/work/_temp/build/package/_CPack_Packages/Darwin/IFW/QtVault-v0.1.2+gbed06b0.20240325092904-Darwin_21.6.0-x86_64-AppleClang/packages/Unspecified/data/./QVaultCli.app CPack Verbose: Installing: /Users/runner/work/_temp/build/package/_CPack_Packages/Darwin/IFW/QtVault-v0.1.2+gbed06b0.20240325092904-Darwin_21.6.0-x86_64-AppleClang/packages/Unspecified/data/./QVaultCli.app/Contents CPack Verbose: Installing: /Users/runner/work/_temp/build/package/_CPack_Packages/Darwin/IFW/QtVault-v0.1.2+gbed06b0.20240325092904-Darwin_21.6.0-x86_64-AppleClang/packages/Unspecified/data/./QVaultCli.app/Contents/MacOS CPack Verbose: Installing: /Users/runner/work/_temp/build/package/_CPack_Packages/Darwin/IFW/QtVault-v0.1.2+gbed06b0.20240325092904-Darwin_21.6.0-x86_64-AppleClang/packages/Unspecified/data/./QVaultCli.app/Contents/MacOS/QVaultCli CPack Verbose: Installing: /Users/runner/work/_temp/build/package/_CPack_Packages/Darwin/IFW/QtVault-v0.1.2+gbed06b0.20240325092904-Darwin_21.6.0-x86_64-AppleClang/packages/Unspecified/data/./QVaultCli.app/Contents/Info.plist
But
macdeploy
is run from thevaultCli
component.
Lets try removing the components in the cmakeinstall
command of the deploy script . -
@Mesrine said in Qt cmake deployment API and Cpack not working for macos:
Unspecified
That was the problem.
It seems thatinstall(TARGETS QVaultCli BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vaultCli )
Do not add the bundle to the
cpack
vaultCli
component. -
M Mesrine has marked this topic as solved on