Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127866

qt_generate_deploy_app_script() writes to wrong directory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.7.2
    • Build tools: qmake
    • None
    • Windows 11
    • Windows

    Description

      example CMakeLists.txt file located in folder c:\cmakeTest

      project(test LANGUAGES CXX)
      find_package(Qt6 REQUIRED COMPONENTS Core)
      qt_add_executable(test Main.cpp)
      qt_generate_deploy_app_script(
        TARGET test
        OUTPUT_SCRIPT script
        NO_UNSUPPORTED_PLATFORM_ERROR
      )

      configure will produce

      PS C:\cmakeTest\build> cmake ..
      -- Building for: Visual Studio 17 2022
      -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
      -- The CXX compiler identification is MSVC 19.40.33813.0
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- Looking for pthread_create in pthreads
      -- Looking for pthread_create in pthreads - not found
      -- Looking for pthread_create in pthread
      -- Looking for pthread_create in pthread - not found
      -- Found Threads: TRUE
      -- Performing Test HAVE_STDATOMIC
      -- Performing Test HAVE_STDATOMIC - Success
      -- Found WrapAtomic: TRUE
      -- Configuring done (3.2s)
      -- Generating done (0.0s)
      -- Build files have been written to: C:/cmakeTest/build
      

      but installing will output

      PS C:\cmakeTest\build> cmake --install .
      – Install configuration: "Release"
      – Writing C:/Program Files (x86)/test/bin/qt.conf
      CMake Error at C:/Daten/Qt/6.7.2/msvc2019_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:93 (file):
      file failed to open for writing (No such file or directory):
      C:/Program Files (x86)/test/bin/qt.conf
      Call Stack (most recent call first):
      C:/Daten/Qt/6.7.2/msvc2019_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:402 (qt6_deploy_qt_conf)
      .qt/deploy_test_c7f832ca98-Release.cmake:5 (qt6_deploy_runtime_dependencies)
      cmake_install.cmake:39 (include)
      

       

      Which means qt_generate_deploy_app_script() tries to write to the install destination directory. But it should not do that, documentation at https://doc.qt.io/qt-6/cmake-deployment.html#deploying-a-qt-widgets-application clearly states:

      The qt_generate_deploy_app_script() command generates the deployment script in the build directory

      ??

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            csab6597 Rainer Bitschi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes