How to use qt_generate_deploy_qml_app_script?
-
I am trying to deploy a Qt Quick application using Qt 6.8 for desktop with the following CMakeLists.txt configuration
cmake_minimum_required(VERSION 3.16) project(DataLogStream VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 REQUIRED COMPONENTS Quick SerialPort Graphs Qml) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(appDataLogStream main.cpp ) qt_add_qml_module(appDataLogStream URI DataLogStream VERSION 1.0 QML_FILES Main.qml QML_FILES PortSelection.qml PlotStream.qml SOURCES portselectionservice.h portselectionservice.cpp plotstreamservice.h plotstreamservice.cpp RESOURCES refresh-icon.svg ) qt_add_resources(appDataLogStream "config" URI DataLogStream FILES qtquickcontrols2.conf ) qt_add_resources(appDataLogStream "images" URI DataLogStream FILES logo.png ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appDataLogStream PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appDataLogStream MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appDataLogStream PRIVATE Qt6::Quick Qt6::SerialPort Qt6::Graphs Qt6::Qml ) include(GNUInstallDirs) install(TARGETS appDataLogStream BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) qt_generate_deploy_qml_app_script( TARGET appDataLogStream OUTPUT_SCRIPT deploy_script NO_UNSUPPORTED_PLATFORM_ERROR ) message("deploy script name: ${deploy_script}") message("qt_deploy_support: ${QT_DEPLOY_SUPPORT}") install(SCRIPT ${deploy_script})
It creates a
QtDeploySupport.cmake
file with this, but when I try to run the application in debug (same in release) I get following error:14:52:22: Process failed: The program "appman-controller.exe" does not exist or is not executable. 14:52:22: Deploy step failed. 14:52:22: Error while building/deploying project DataLogStream (kit: Desktop Qt 6.8.2 MSVC2022 64bit) 14:52:22: When executing step "Install Application Manager package"
I am not sure what I am missing, I have already installed Qt Installer Framework. Do I need to install anything else?
-
It seems to be working now, I had to change
appDataLogStream
toDataLogStream
and I am able to run it. Not sure why though. But I still don't understand how to useqt_generate_deploy_qml_app_script
? What should I do with the generated script?