FUNCTION( USE_CPP11 )
	FOREACH( Target ${ARGN} )
		IF( Target STREQUAL "TARGET" )
			SET( MODE "TARGET" )
		ELSEIF( Target STREQUAL "SOURCE" )
			SET( MODE "SOURCE" )
		ELSE(  )
			IF( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
				IF( MSVC11 OR MSVC12 )
				ELSE(  )
					MESSAGE( SEND_ERROR "Visual Studio version is too low to use C++11 standard" )
				ENDIF(  )
			ELSEIF( (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") )
				IF( MODE STREQUAL "TARGET" )
					SET_PROPERTY( ${MODE} ${Target} APPEND_STRING PROPERTY LINK_FLAGS " -stdlib=libc++" )
				ENDIF(  )
				SET_PROPERTY( ${MODE} ${Target} APPEND_STRING PROPERTY COMPILE_FLAGS " -std=c++11 -stdlib=libc++" )
			ENDIF(  )
		ENDIF(  )
	ENDFOREACH(  )
ENDFUNCTION( USE_CPP11 )
