]> Creatis software - cpPlugins.git/commitdiff
MSVC c++11 update
authorjose guzman <jose@gmail.com>
Thu, 8 Oct 2015 15:53:54 +0000 (17:53 +0200)
committerjose guzman <jose@gmail.com>
Thu, 8 Oct 2015 15:53:54 +0000 (17:53 +0200)
CMakeLists.txt

index c15e1286d6f72ea8aa4a09aa2ed9595b83fca595..76b21ce10d7efb99d67b0bb61fddbc09a66cd609 100644 (file)
@@ -47,16 +47,19 @@ ENDIF(BUILD_SHARED_LIBRARIES)
 ## = Packages and options =
 ## ========================
 
-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()
+# 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)