Visual Studio offers the notion of toolsets, e.g. for Visual Studio 2015 and the optional "Windows XP Support for C++" package, there are the toolsets v140
and v140_xp
. In case, someone added the "Clang with Microsoft CodeGen" package, there is v140_clang_c2
.
With CMake, I can use the -T
command line flag to specify the toolset to be used for the solution files generated with CMake, e.g. cmake -T v140_clang_c2
will generate the project solution file with "Visual Studio 2015 - Clang with Microsoft CodeGen (v140_clang_c2)" configured as the "Platform Toolset" for all targets.
How can I tell Conan on Windows with an appropriate installed Visual Studio to use a specific toolset? Preferably for conanfiles using CMake as the generator.
The only way I could come up with is to add an additional option to all the projects/conanfile.py I'd like to use with different toolsets and add another package option (e.g. used as -o toolset=v140_clang_c2
) to be added to the command line of the initial invocation of CMake.
I'd expect that variability to be part of the package manager itself rather than the responsibility of the package writers.