# TOOLSET ツールセット名
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
  if(${CMAKE_GENERATOR} MATCHES "Visual Studio 17 2022")
    set(MSVC_TOOLSET_VERSION 143)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 16 2019")
    set(MSVC_TOOLSET_VERSION 142)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 15 2017")
    set(MSVC_TOOLSET_VERSION 141)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 14 2015")
    set(MSVC_TOOLSET_VERSION 140)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 12 2013")
    set(MSVC_TOOLSET_VERSION 120)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 11 2012")
    set(MSVC_TOOLSET_VERSION 110)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 10 2010")
    set(MSVC_TOOLSET_VERSION 100)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 9 2008")
    set(MSVC_TOOLSET_VERSION 90)
  elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005")
    set(MSVC_TOOLSET_VERSION 80)
  else()
    set(MSVC_TOOLSET_VERSION "Unknown")
    message(FATAL_ERROR "unknown Visual Studio ${CMAKE_GENERATOR}")
  endif()
  set(TOOLSET "VS_${MSVC_TOOLSET_VERSION}")
elseif((${CMAKE_GENERATOR} MATCHES "Unix Makefiles") OR
    (${CMAKE_GENERATOR} MATCHES "MSYS Makefiles") OR
    (${CMAKE_GENERATOR} MATCHES "MinGW Makefiles") OR
    (${CMAKE_GENERATOR} MATCHES "Ninja"))
  set(TOOLSET "mingw")
elseif(${CMAKE_GENERATOR} MATCHES "NMake Makefiles")
  set(TOOLSET "VS_NMake")
else()
  message(FATAL_ERROR "unknown GENERATOR ${CMAKE_GENERATOR}")
endif()
