summaryrefslogtreecommitdiffstats
path: root/cmake/UseCXX11.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/UseCXX11.cmake')
-rw-r--r--cmake/UseCXX11.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/UseCXX11.cmake b/cmake/UseCXX11.cmake
new file mode 100644
index 00000000..e94de2bb
--- /dev/null
+++ b/cmake/UseCXX11.cmake
@@ -0,0 +1,13 @@
+if(__USECXX11_CMAKE__)
+ return()
+endif()
+set(__USECXX11_CMAKE__ TRUE)
+
+if(APPLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(UNIX)
+ # assume GCC, add C++0x/C++11 stuff
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(MINGW)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+endif()