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

ninja error after moving the default qt_add_qml_module to a subdirectory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.7.2
    • None
    • Qt Creator 13.0.2
    • Windows

    Description

      I created a default Qt Quick Application project and then moved Main.qml to the ui folder.

      The current directory structure is as follows:

      untitled 
      ├── CMakeLists.txt 
      ├── main.cpp 
      └── ui 
             ├── CMakeLists.txt 
             └── Main.qml

      ui/CMakeLists.txt

      qt_add_qml_module(appuntitled
          URI untitled
          VERSION 1.0
          QML_FILES
              Main.qml
      ) 

      CMakeLists.txt

      ...default context...
      
      qt_add_executable(appuntitled
          main.cpp
      )
      add_subdirectory(ui)
      
      ...default context...

      This setup compiles and runs successfully.

      However, if I delete the build files (clean and rebuild does not help), I encounter the following compilation error:

      [1/16 15.9/sec] Running rcc for resource qmake_untitled
      [2/16 31.2/sec] Automatic QML type registration for target appuntitled
      FAILED: appuntitled_qmltyperegistrations.cpp ui/untitled/appuntitled.qmltypes C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/appuntitled_qmltyperegistrations.cpp C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/ui/untitled/appuntitled.qmltypes 
      C:\Windows\system32\cmd.exe /C "cd /D C:\Users\zyen\Desktop\untitled\build\Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug\ui && C:\Users\zyen\Desktop\untitled\build\Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug\.qt\bin\qt_setup_tool_path.bat D:/Studio/Lib/Qt/6.7.2/llvm-mingw_64/./bin/qmltyperegistrar.exe --generate-qmltypes=C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/ui/untitled/appuntitled.qmltypes --import-name=untitled --major-version=1 --minor-version=0 @C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/qmltypes/appuntitled_foreign_types.txt -o C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/appuntitled_qmltyperegistrations.cpp C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/meta_types/qt6appuntitled_debug_metatypes.json && D:\Studio\Lib\Qt\Tools\CMake_64\bin\cmake.exe -E make_directory C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/.qt/qmltypes && D:\Studio\Lib\Qt\Tools\CMake_64\bin\cmake.exe -E touch C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/.qt/qmltypes/appuntitled.qmltypes"
      [3/16 40.5/sec] Copying Main.qml to C:/Users/zyen/Desktop/untitled/build/Desktop_Qt_6_7_2_llvm_mingw_64_bit-Debug/ui/untitled/Main.qml
      [4/16 50.6/sec] Running rcc for resource appuntitled_raw_qml_0
      [5/16 61.7/sec] Generating ../.rcc/qmlcache/appuntitled_qmlcache_loader.cpp
      [6/16 57.7/sec] Running qmlimportscanner for appuntitled
      ninja: build stopped: subcommand failed. 

      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
            zyen 袁 梓恩
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes