I am using vcpkg and I would like to set the variable VCPKG_TARGET_TRIPLET to my specific triplet.
The help here https://vcpkg.readthedocs.io/en/latest/users/integration/#using-an-environment-variable-instead-of-a-command-line-option (bottom of the page) says you need to pass it as a -D option to CMake, but I would like to set it in my CMakeLists.txt.
I have tried the following two options, but both do not seem to work:
set(VCPKG_TARGET_TRIPLET "x64-mingw-static" CACHE STRING "") # doesn't work
set(VCPKG_TARGET_TRIPLET "x64-mingw-static") # also doesn't work
The reason I want to do this in CMakeLists.txt and not the command line is because of my current setup with VS Code and the CMakeTools extension.
How can I "simulate" the -D flag inside my CMakeLists?
I should also mention that my whole "project" consists of a top-level CMakeLists as a sort of "master project" which then includes a sub-folder with another CMakeLists and my "actual" project (the one with the find_package commands).