cmake-conan
cmake-conan copied to clipboard
Compiler toolset is not set automatically
I am using v0.14 of this script to build a project with Visual Studio 2019.
I expected the value of settings.compiler.toolset
to be 'v142'
, but instead it is None
This information should be available to CMake (probably through CMAKE_VS_PLATFORM_TOOLSET
), so it would be great if it could set it automatically like the rest of the compiler settings.
Hi @rick-de-water,
If you want cmake-conan to detect the toolset you have to provide the information through the command line when calling CMake via the cmake -T
option.
cmake .. -G "Visual Studio 16 2019" -T v142
Hope this helps :)
conan_cmake_run doesn't respect current toolset. I'm using older toolchain
cmake -G"Visual Studio 16 2019" -Tversion=14.26
On higher level I have proper detection from my project(...) The CXX compiler identification is MSVC 19.26.28808.1
But it isn't forwarded to conan which just takes latest version "compiler.toolset=v142"
same when running
cmake -G"Visual Studio 16" -T v140
Is it expected that you need to manually specify something like -DCONAN_SETTINGS_COMPILER_TOOLSET=v140
on the command line?
Not sure whether this is even correct, but it seems to be able to create visual studio projects now...