From fd7c3b3543e707c9d5d3d081c5a313b42d79b3be Mon Sep 17 00:00:00 2001 From: JohnStott Date: Wed, 31 Aug 2016 19:51:16 +0100 Subject: [PATCH] MS Visual Studio 2015 fix (#1530) Fixed to work with future versions of visual studio i.e., 2015 MSVC has it's own section for setting compile parameters, it shouldn't need to fall into section below i.e., checking for c++11 as this is definitely already supported, though this isn't an issue for Visual Studio 2012, it breaks for later versions of visual studio i.e., 2015 when the default c++ is version 14. Though still backward compatible with c++11 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index edb569301..ab1dec833 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,10 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -fPIC") # Make sure we are using C++11 # Visual Studio 12.0 and newer supports enough c++11 to make this work -if(MSVC AND MSVC_VERSION LESS 1800) +if(MSVC) + if(MSVC_VERSION LESS 1800) message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + endif() else() # GCC 4.6 with c++0x supports enough to make this work include(CheckCXXCompilerFlag)