macro(set_cpp_standard YEAR)
  if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${YEAR}")
  elseif (MSVC AND ${YEAR} STRGREATER 11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++${YEAR}")
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${YEAR}")
  endif ()
endmacro()
