'Using VCPKG with cmake and Qt 6 for Windows ARM64

Qt 6.2 introduced Windows on Arm support (https://bugreports.qt.io/browse/QTBUG-85820). I tried to create a new cmake project set up using Qt Creator and everything works fine. Then I wanted to add some external packages to my project using vcpkg. The standard way to use vcpkg with cmake is using the CMAKE_TOOLCHAIN_FILE variable (as mentioned here. However, when I clicked on project settings in Qt Creator (Projects > Build) it seems that Qt Creator has already set up the CMAKE_TOOLCHAIN_FILE variable to another file

Qt Creator CMake settings for Qt 6.3.0 MSCV 2019 ARM64

Presumably, this is done so that it is possible to cross-compile an ARM64 binary from a x64 machine. However, this prevents me from setting up vcpkg within my Qt project. Is there a way to get around this issue? Does CMake support multiple toolchain files or is there an alternative setup for my scenario?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source