Provide define MSVC_TOOLSET_VERSION or MSVC_IDE_VERSION
Even your code had a lot duplication about that:
- toolset: https://github.com/Kitware/CMake/blob/59f07efd592330be3018fcaa253498475055a4af/Modules/FindwxWidgets.cmake#L501-L513
- toolset: https://github.com/Kitware/CMake/blob/cfa55fd428360776c442a5e3c5724c6253265fed/Modules/FindRuby.cmake#L210-L224
- toolset: https://github.com/Kitware/CMake/blob/cfa55fd428360776c442a5e3c5724c6253265fed/Modules/FindGTK2.cmake#L357-L366
- toolset: https://github.com/Kitware/CMake/blob/c4f9d104269938d8111030a05268b19a0f493098/Modules/FindIce.cmake#L169-L191
- ide: https://github.com/Kitware/CMake/blob/be2c45f2a98d69cc9952b592777bb506f69149a2/Modules/InstallRequiredSystemLibraries.cmake#L174-L192
- ide: https://github.com/Kitware/CMake/blob/989ca432e4d842e50f07a1ff05dc4a65fc9881cb/Tests/VSWinStorePhone/CMakeLists.txt#L3-L9
Toolset version should be for VS2017 "141", IDE version "15". CMake uses the IDE version in the generator name. I can easily convert one to other, so you can provide any of this.
Edited by Arkady Shapkin