if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.8)
        message(WARNING "Enabling partial C++11 support for GCC < 4.8!")
        add_definitions("-std=c++0x")
    else ()
        add_definitions("-std=c++11")
    endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 2.9)
        message(WARNING "Disabling C++11 support for CLANG < 2.9!")
    else ()
        add_definitions("-std=c++11")
    endif ()
else ()
    message(WARNING "Unknown compiler ${CMAKE_CXX_COMPILER_ID}. Using default flag -std=c++11")
    add_definitions("-std=c++11")
endif ()
