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

qmlcache problem when referencing Qml files outside of current directory tree

    XMLWordPrintable

Details

    • Windows

    Description

      Compilation fails when Qml files are located outside of the current directory tree (for instance in a parent's sub-directory, see attached example project):

      11:39:19: Starting: "C:\QtCommercial\Tools\CMake_64\bin\cmake.exe" --build C:/Users/dev/Desktop/Projects/test/subdirtest/build-src-Desktop_Qt_6_4_0_MSVC2019_64bit-Release --target all
      [1/20 32.2/sec] Generating com/qml/main.qml
      [2/20 55.8/sec] Generating .rcc/qmlcache/subdirtest_qmlcache_loader.cpp
      [3/20 68.8/sec] Running qmlimportscanner for subdirtest
      [4/20 14.8/sec] Automatic MOC for target subdirtest
      [5/20 16.9/sec] Running AUTOMOC file extraction for target subdirtest
      [6/20 19.2/sec] Running rcc for resource subdirtest_raw_qml_0
      [7/20 22.3/sec] Running rcc for resource qmake_com_test
      [8/20 25.4/sec] Running rcc for resource qmake_com_test_copy
      [9/20 26.0/sec] Running moc --collect-json for target subdirtest
      [10/20 22.8/sec] Automatic QML type registration for target subdirtest
      ninja: error: mkdir(.rcc/qmlcache/subdirtest_../qml): No such file or directory
      ninja: build stopped: .
      11:39:20: The process "C:\QtCommercial\Tools\CMake_64\bin\cmake.exe" exited with code 1.
      Error while building/deploying project subdirtest (kit: Desktop Qt 6.4.0 MSVC2019 64bit)
      When executing step "Build"
      11:39:20: Elapsed time: 00:04.
      

      The problem also happens when adding source directories which contain Qml files like this:

      # sample/CMakeLists.txt:
      add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../appbasis ${CMAKE_CURRENT_BINARY_DIR}/appbasis) 
      
      # Directory structure used:
      # appbasis/CMakeLists.txt
      # appbasis/SomeQmlFile.qml (referenced by appbasis/CMakeLists.txt)
      # sample/CMakeLists.txt
      

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              Harald Meyer Harald Meyer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes