From adab702a13b6d64bd50ce0e3db7aa6a8574459d5 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Mon, 27 Jul 2015 10:46:20 +0200 Subject: [PATCH] [cmake] Use -std=c++0x if -std=c++11 is not available --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7266ebbe0..ba2abf569b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,11 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g") ## We need a decent support of the c++11 standard include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else() message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. " -- 2.20.1