Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.4.0
-
None
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
- relates to
-
QTBUG-122702 QML modules' don't work if defined in subdirectory of target (CMake API)
- Open