Description: Use C++11
 This code actually uses some C++11 features, but doesn't enable them in
 the compiler.
 .
 kicad (4.0.4+dfsg1-2~bpo8+1) jessie-backports; urgency=medium
 .
   * Backport to Debian jessie
Author: Simon Richter <sjr@debian.org>
Forwarded: no
Last-Update: 2017-01-31

--- kicad-4.0.4+dfsg1.orig/CMakeLists.txt
+++ kicad-4.0.4+dfsg1/CMakeLists.txt
@@ -83,6 +83,11 @@ mark_as_advanced( KICAD_SKIP_BOOST )
 option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
 
 
+# Global setting: Use C++11
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+
 # This can be set to a custom name to brag about a particular branch in the "About" dialog:
 set( KICAD_REPO_NAME "product" CACHE STRING "Name of the tree from which this build came." )
 
@@ -122,6 +127,20 @@ include( PerformFeatureChecks )
 perform_feature_checks()
 
 
+if( CMAKE_VERSION VERSION_LESS 3.1 AND ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) )
+    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(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+    endif()
+endif()
+
+
+
 #================================================
 # Set flags for GCC, or treat llvm as GCC
 #================================================
