Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems with qt_deploy_runtime_dependencies
Forum Updated to NodeBB v4.3 + New Features

Problems with qt_deploy_runtime_dependencies

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 905 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    I'm trying to get a deploy script setup to do what I want which is to invoke the deployment with the options --verbose 1 --pdb

    No such luck:

        set(deploy_tool_options_arg ${deploy_tool_options_arg}"--verbose 1 --hardened-runtime")
    elseif(WIN32)
        set(deploy_tool_options_arg ${deploy_tool_options_arg}"--verbose 1 --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 ("Qt Deploy Bin Dir: " ${QT_DEPLOY_BIN_DIR})
        message ("Target filename:"  $<TARGET_FILE_NAME:DeepSkyStacker>)
        set(executable_path "\${QT_DEPLOY_BIN_DIR}/$<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}"
         GENERATE_QT_CONF
         VERBOSE
     )")
    

    gets me

    CMake Warning (dev) at DeepSkyStacker/CMakeLists.txt:223:
    1> [CMake]   Syntax Warning in cmake code at column 27
    1> [CMake] 
    1> [CMake]   Argument not separated from preceding token by whitespace.
    1> [CMake] This warning is for project developers.  Use -Wno-dev to suppress it.
    1> [CMake] 
    1> [CMake] CMake Warning (dev) at DeepSkyStacker/CMakeLists.txt:223:
    1> [CMake]   Syntax Warning in cmake code at column 53
    1> [CMake] 
    1> [CMake]   Argument not separated from preceding token by whitespace.
    1> [CMake] This warning is for project developers.  Use -Wno-dev to suppress it.
    1> [CMake] 
    1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
    1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
    1> [CMake] Qt Deploy Bin Dir: .
    1> [CMake] Target filename:$<TARGET_FILE_NAME:DeepSkyStacker>
    1> [CMake] executable_path: ${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>
    1> [CMake] deploy tools options arg: "--verbose 1 --pdb"
    1> [CMake] CMake Error at C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:3603 (message):
    1> [CMake]   Unexpected arguments: "--verbose 1 --pdb";
    1> [CMake] 
    1> [CMake]        GENERATE_QT_CONF
    1> [CMake]        VERBOSE
    1> [CMake]    )
    1> [CMake] Call Stack (most recent call first):
    1> [CMake]   C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:3687 (qt6_generate_deploy_script)
    1> [CMake]   DeepSkyStacker/CMakeLists.txt:217 (qt_generate_deploy_script)
    1> [CMake] -- Configuring incomplete, errors occurred!
    

    line 223 is the one that reads:

         DEPLOY_TOOL_OPTIONS "${deploy_tool_options_arg}"
    

    Am I doing something wrong? This was pretty much cribbed direct from the documentation of qt_deploy_runtime_dependencies

    David

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The following: set(deploy_tool_options_arg ${deploy_tool_options_arg}"--verbose 1 --pdb") looks wrong to me.

      I think it should rather be:

      set(deploy_tool_options_arg "${deploy_tool_options_arg} --verbose 1 --pdb")
      endif()
      

      Or since it's a list, you could also use the cmake list directive.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by
        #3

        @SGaist Thank you!!! That's almost got me where I wanted.

        I now have:

        #
        # Force the values of QT_DEPLOY... variables
        #
        set (QT_DEPLOY_BIN_DIR ".")
        set (QT_DEPLOY_LIBEXEC_DIR ".")
        set (QT_DEPLOY_LIB_DIR ".")
        set (QT_DEPLOY_PLUGINS_DIR ".")
        
        #
        # Set options for the deployment script
        #
        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 ("Qt Deploy Bin Dir: " ${QT_DEPLOY_BIN_DIR})
            message ("Target filename:"  $<TARGET_FILE_NAME:DeepSkyStacker>)
            set(executable_path "\${QT_DEPLOY_BIN_DIR}/$<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}
             GENERATE_QT_CONF
             VERBOSE
         )"
         )
        

        which almost works.

        However, even though I have set QT_DEPLOY_LIB_DIR, it is writing the Qt Dlls etc. to a bin sub-directory of the install directory:

          -- Installing: C:/Users/amonra/Documents/GitHub/DSS/x64/Debug/./DeepSkyStacker.exe
          -- Writing C:/Users/amonra/Documents/GitHub/DSS/x64/Debug/bin/qt.conf
          -- Running Qt deploy tool for ./DeepSkyStacker.exe in working directory 'C:/Users/amonra/Documents/GitHub/DSS/x64/Debug'
          'C:/Qt/6.8.0/msvc2022_64/bin/windeployqt.exe' './DeepSkyStacker.exe' '--verbose' '2' '--dir' '.' '--libdir' 'bin' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--qtpaths' 'C:/Qt/6.8.0/msvc2022_64/bin/qtpaths6.exe' '--pdb'
        
        

        which I don't quite understand.

        How to fix that please?

        1 Reply Last reply
        0
        • PerdrixP Perdrix referenced this topic on
        • PerdrixP Offline
          PerdrixP Offline
          Perdrix
          wrote on last edited by
          #4

          I was able to force the use of --libdir . by adding it to the deploy_tool_options_arg variable.

          That resulted in an invocation that looked like this:

          'C:/Qt/6.8.0/msvc2022_64/bin/windeployqt.exe' './DeepSkyStacker.exe' '--verbose' '2' '--dir' '.' '--libdir' 'bin' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--qtpaths' 'C:/Qt/6.8.0/msvc2022_64/bin/qtpaths6.exe' '--pdb' '--libdir' '.'
          

          which is pretty tacky :(

          If QT_DEPLOY_LIB_DIR is set to . shouldn't that do the job automatically?

          1 Reply Last reply
          0
          • PerdrixP Offline
            PerdrixP Offline
            Perdrix
            wrote on last edited by
            #5

            https://bugreports.qt.io/browse/QTBUG-130915

            1 Reply Last reply
            0
            • joborJ Offline
              joborJ Offline
              jobor
              wrote on last edited by
              #6

              Hi, quickly re-iterating my response on the bug report:

              The QT_DEPLOY_LIB_DIR variable is read-only and needs to be modified by setting the corresponding CMAKE_INSTALL_LIBDIR variable.

              This is from the variable's documentation:

              QT_DEPLOY_LIB_DIR defaults to the value of ${CMAKE_INSTALL_LIBDIR} (usually lib or lib64), which is provided by CMake's GNUInstallDirs module. To change the value of QT_DEPLOY_LIB_DIR, ensure that the project sets CMAKE_INSTALL_LIBDIR before the Core package is found.
              

              The example at the bottom of that page shows how to change the values.

              Changing QT_DEPLOY_LIB_DIR this way should be reflected in windeployqt's options too.

              1 Reply Last reply
              0
              • PerdrixP Offline
                PerdrixP Offline
                Perdrix
                wrote on last edited by
                #7

                Thanks for your update. I have updated the bug report, as it seems not to work quite as you indicated.

                1 Reply Last reply
                0
                • PerdrixP Offline
                  PerdrixP Offline
                  Perdrix
                  wrote on last edited by
                  #8

                  I've added proof that the Qt_DEPLOY... variables aren't being set correctly to the bug report

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved