VS Tools in VS2022 do not work with vcpkg installed Qt6
-
I am trying to convert a VS2017/vs-addins Qt5 project to VS2022 and Qt6. I have installed VS2022 (17.10.3) and Qt VS Tools (3.2.0 rev47) from the Extension Manager. I am managing several projects on the computer and I try to have them share open source libraries by managing those with a current vcpkg instance. Among others, qtbase (Qt 6.7.2) is installed. I added that library as the default Qt version to VS by selecting the qmake.exe in C:\vcpkg\installed\x64-windows\tools\Qt6\bin\qmake.exe. This seems to be ok, as the Qt VS Tools startup reports 'qt6 check OK'.
However, VS then tries to load the project file and fails with:
[...]AppData\Local\QtMsBuild\qt_private.props(209,5): The expression "[System.IO.File]::ReadAllText(C:\vcpkg\installed\x64-windows\tools\Qt6\mkspecs\qconfig.pri)" cannot be evaluated. Could not find a part of the path [... offending path repeated]I have checked qt_private.props and sure enough, the rule given there to build the offending path does not work, the path should read ... x64-windows\share\Qt6 ... I have tried to patch the qt_private.props to this end, but somehow it gets overwritten each time that VS starts.
So for now my conclusion is that vcpkg seems to meddle a bit with the expected installation paths and thus the rule in qt_private.props fails (that would require me to have an extra installation of qt6 around). But then that rule to find qconfig.pri could also be an unwarranted assumption, which means that I am looking at a bug in the VS Tools extension.
I'd like to get an expert opinion on this.
-
I run
vcpkg install qt5
and then mount its qmake to msvc2019 by Qt Add-on, compile release of my project is well, but debug doesn't, debug placed in /debug/bin, /debug/lib and both cant be found by msvc add-on. I thought how to combine release and debug changing cmake directives