From 6b47861cd47a6e31841260c47a52b579f8cf2fa9 Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Sun, 4 Nov 2018 21:52:28 +0000 Subject: [PATCH] Enable c++11 (#13) Enable c++11 --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6df1f64..169ae92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(SGP4) +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +else() + message(SEND_ERROR "The compiler ${CMAKE_CXX_COMPILER} doesnt support C++11.") +endif() + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")