qt

qt_generate_deploy_app_script() is error with "Given qt.conf path is not an absolute path" on Windows


I'm using a new qt_generate_deploy_app_script on Qt 6 to generate a deployment script. It is working fine on macOS but on Windows it give the following error:

Given qt.conf path is not an absolute path: 'dist/bin/qt.conf'

My CMake:

if(WIN32)
    install(TARGETS obliteration DESTINATION .)
else()
    install(TARGETS obliteration BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

qt_generate_deploy_app_script(
    TARGET obliteration
    OUTPUT_SCRIPT QT_DEPLOY_SCRIPT
    NO_TRANSLATIONS
    NO_COMPILER_RUNTIME)

install(SCRIPT ${QT_DEPLOY_SCRIPT})

Solution

  • I know it's old but I just had this issue. When calling cmake install with a prefix, use an absolute path. For example:

    cmake --install . --prefix $PWD/../install