Don't use -std compiler flag if CMAKE_CXX_STANDARD is specified (#366)
diff --git a/support/cmake/cxx11.cmake b/support/cmake/cxx11.cmake
index 31ea106..02795a9 100644
--- a/support/cmake/cxx11.cmake
+++ b/support/cmake/cxx11.cmake
@@ -37,6 +37,11 @@
endif ()
endif ()
+if (CMAKE_CXX_STANDARD)
+ # Don't use -std compiler flag if CMAKE_CXX_STANDARD is specified.
+ set(CPP11_FLAG )
+endif ()
+
set(CMAKE_REQUIRED_FLAGS ${CPP11_FLAG})
# Check if variadic templates are working and not affected by GCC bug 39653: