macro(compiler_check)
    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
        if (NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 3.4))
            message(FATAL_ERROR "${PROJECT_NAME} requires clang 3.4 or greater.")
        endif ()
    elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
        if (NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.9))
            message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.9 or greater.")
        endif ()
    elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
        if (NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 19))
            message(FATAL_ERROR "${PROJECT_NAME} requires msvc 19 or greater.")
        endif ()
    else ()
        message(FATAL_ERROR "Your C++ compiler does not support C++14.")
    endif ()
endmacro()
