From 88f33010eb8a072937049971a5f47bf005b027d1 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Thu, 15 Oct 2015 07:01:44 -0500 Subject: [PATCH] CMake project updated --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bf1a02..b8b86f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,21 @@ ENDIF(BUILD_SHARED_LIBS) ## = Packages = ## ============ +# NOTE: It seems that by default on Visual Studio Compiler supports c++11, +# so it only need to be test on other O.S. +IF(NOT MSVC) + 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(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + ENDIF() +ENDIF(NOT MSVC) + # Prepare header to build shared libs (windows) INCLUDE(GenerateExportHeader) -- 2.47.1