
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
	include(CheckCXXCompilerFlag)
	check_cxx_compiler_flag(--std=c++11 SUPPORTS_STD_CXX11)
	check_cxx_compiler_flag(--std=c++0x SUPPORTS_STD_CXX0X)
	if(SUPPORTS_STD_CXX11)
		message("-- Enabling C++11 support with --std=c++11.")
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
	elseif(SUPPORTS_STD_CXX0X)
		message("-- Enabling C++11 support with --std=c++0x.")
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
	else()
		message(ERROR "Compiler does not support C++11.")
	endif()
endif()
