I have a cmake project for building a shared C++ library on Windows. There I would like to append the PlatformToolset information to the libraries file name.
I know the cMake variable CMAKE_GENERATOR_TOOLSET where the Platform Toolset is defined when it is specified with the configuration command. e.g.: cmake -G "Visual Studio 16 2019" -A x64 -T v141 .
Unfortunately the CMAKE_GENERATOR_TOOLSET variable is not defined when the default toolset (-T
option not specified) is used.
Is there any way to get the default toolset information in my CMakeLists.txt
file? Or does I have to manually define the Toolset information based on the MSVC_VERSION?