-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.3
-
None
-
Windows11 vcpkg MSVC
I'm trying to use vcpkg with cmake to resolve `qtdeclarative` package dependency in manifest mode. When I try to run `cmake --install` in debug config, it copys release qml dlls into <install_dir>/qml/ directory. This also results that the dependent <install_dir>/plugin/ directory cannot be resolved properly. Its worth noting that when installing release build it works properly, because `QtInstallPaths.cmake` records the right path for qt release depencency but not for debug one, which is in <qt_path>/debug/... according to vcpkg package layout.
I try to solve the debug dll issue by following the path resolving process, hope the process below to be useful for you:
- cmake configure:
- `find_package(Qt6...)`: it reads `QtInstallPaths.cmake` and get package layout directory variables, `<qt_path>` for `QT6_INSTALL_PREFIX` and `Qt6/qml` for `QT6_INSTALL_QML`
- `qt_add_executable(<target>)`: it adds a task named `<target> finalize` to be executed after cmake configure process
- `<target> finalize`: it generates a file at `<cmake_build_dir>/<target>/.qt/qml_imports/<target>_build.rsp`. The `-importPath` part in this file includes a entry named `QT6_INSTALL_PREFIX/QT6_INSTALL_QML`, that is __ `<qt_path>/Qt6/qml`, which is the right path for release qml depencency not for debug.
- cmake build: generates `<cmake_build_dir>/<target>/.qt/qml_imports/<target>_build.cmake`, using the release qml path
- cmake install:
- runs `qt6_deploy_qml_imports` using the 2. <target>_build.cmake file, and copys the wrong release qml dlls into `<cmake_install_dir>/qml/...`
- `qt6_deploy_runtime_dependencies`: cannt resolve copied release qml dlls dependencies. No `<cmake_install_dir>/plugin/...` dlls is copied.
> BTW, I cannt run the exe target in an IDE(VS) without installing, too. It's acceptable for me to get the installing issue solved first, but I still wonder how can i resolve qt dependency when running the exe target without installing?
Update: I modified the calqlatr example in qt quick examples to a vcpkg project. Maybe you can replecate this issue by
# $env:VCPKG_ROOT="<your_vcpkg_root>"
set VCPKG_ROOT=<your_vcpkg_root>
cd calqlatr
cmake . --preset=vcpkg
cd build/vcpkg
cmake --build .
cmake --install .
For Gerrit Dashboard: QTBUG-139273 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
670609,5 | CMake deploy: Fix qml module file install path in debug build | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |