- 
    Bug 
- 
    Resolution: Fixed
- 
    P2: Important 
- 
    6.8
- 
    None
- 
        f86d1a58b (dev), 1694b5787 (6.9)
I am trying to use qt_add_qml_module command while placing QML sources in a sub-folder with its own CMakeLists file. In the view-folders CMakeLists:
qt_add_library(MainModule STATIC)
qt_add_qml_module(MainModule
    URI main_module
    VERSION 1.0
    QML_FILES
        Main_Page.qml
)
add_subdirectory(submodule) 
In the sub-folders CMakeLists:
qt_target_qml_sources(MainModule
    QML_FILES
        Sub_Page.qml
) 
However, it seems like I am missing something as the build is unsuccessful (GCC compiler) given the following error.
<project_folder>\modularMinQml\min_qml_module\build\Desktop_Qt_6_6_3_MinGW_64_bit-Debug\view\submodule\.rcc\qmlcache\MainModule_Sub_Page_qml.cpp:-1: error: <project_folder>/modularMinQml/min_qml_module/build/Desktop_Qt_6_6_3_MinGW_64_bit-Debug/view/submodule/.rcc/qmlcache/MainModule_Sub_Page_qml.cpp: No such file or directory
It worth noting that the project runs smoothly with qt_target_qml_sources written in the same CMakeLists as qt_add_qml_module.
A minimal project regarding the problem is available at: minimal_qml_module where the structure tree is as follows
{{}}
D:.
│   CMakeLists.txt
│
├───main
│       CMakeLists.txt
│       header.h
│       main.cpp
│
└───view
    │   CMakeLists.txt
    │   Main_Page.qml
    │
    └───submodule
            CMakeLists.txt
            Sub_Page.qml
Any help would be appreciated.
- relates to
- 
                    QTBUG-95200 qt6_add_qml_module only works when used in same folder than the backing library -         
- Closed
 
-         
- 
                    QTBUG-99768 qt_add_qml_module: resource base dir -         
- Reported
 
-         
- 
                     QTBUG-130757
        Calling find_pacakge(Qt) in a specific directory scope and using the targets in sibling scopes can lead to issues QTBUG-130757
        Calling find_pacakge(Qt) in a specific directory scope and using the targets in sibling scopes can lead to issues-         
- Open
 
-