Home > Blockchain >  Using VCPKG with cmake and Qt 6 for Windows ARM64
Using VCPKG with cmake and Qt 6 for Windows ARM64

Time:03-06

Qt 6.2 introduced Windows on Arm support (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?

CodePudding user response:

I found out that VCPKG provides a way to achieve this as explained here:

To use an external toolchain file with a project using vcpkg, you can set the cmake variable VCPKG_CHAINLOAD_TOOLCHAIN_FILE on the configure line:

cmake ../my/project \
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \ -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=../my/project/compiler-settings-toolchain.cmake

So in my case, I can just qt toolchain file using VCPKG_CHAINLOAD_TOOLCHAIN_FILE option.

  • Related