You actually don't need to run vcvarsall.bat manually. CLion will take care of it. You need to:
configure Visual Studio toolchain in CLion
specify this toolchain in your preset using this JSON fragment:
An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field. If vendors use their own per-preset vendor field, they should implement inheritance in a sensible manner when appropriate.
I will have a look at it, thank you :)
Yes, I know...
I have tried out CMake presets and they are amazing. I still have a problem to load MVSC presets in CLion. I have a configure preset like this one:
From the command-line, I must call
vcvarsall.batto configure the compiler before callingcmake --preset=a-preset-that-inherits-from-this-one.In CLion, do you know how I can call this script when I use the action "Load CMake presets"?
The answer from my colleague:
You actually don't need to run vcvarsall.bat manually. CLion will take care of it. You need to:
configure Visual Studio toolchain in CLion
specify this toolchain in your preset using this JSON fragment:
Here's a more detailed instruction: jetbrains.com/help/clion/cmake-pre...
That's even better than asking the support directly! Thanks 😁
It does work if I add the key to the derived preset, but it does work on the base preset. It seems that the "vendor" map is not inherited.
When I read the documentation, it looks like a bug to me:
Yeah, you are right. Now there is a ticket about it
youtrack.jetbrains.com/issue/CPP-2...
That's perfect :)