summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindCXX11.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/modules/FindCXX11.cmake')
-rw-r--r--project/cmake/modules/FindCXX11.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/project/cmake/modules/FindCXX11.cmake b/project/cmake/modules/FindCXX11.cmake
new file mode 100644
index 0000000..f1b7346
--- /dev/null
+++ b/project/cmake/modules/FindCXX11.cmake
@@ -0,0 +1,18 @@
1include(TestCXXAcceptsFlag)
2
3# try to use compiler flag -std=c++11
4check_cxx_accepts_flag("-std=c++11" CXX_FLAG_CXX11)
5if(CXX_FLAG_CXX11)
6 add_options (CXX ALL_BUILDS "-std=c++11")
7 set(CXX_STD11_FLAGS "-std=c++11")
8else()
9 # try to use compiler flag -std=c++0x for older compilers
10 check_cxx_accepts_flag("-std=c++0x" CXX_FLAG_CXX0X)
11 if(CXX_FLAG_CXX0X)
12 add_options (CXX ALL_BUILDS "-std=c++0x")
13 set(CXX_STD11_FLAGS "-std=c++0x")
14 endif(CXX_FLAG_CXX0X)
15endif(CXX_FLAG_CXX11)
16
17include(FindPackageHandleStandardArgs)
18find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS)