From 9fc8b732737f139d3e466510d75668ab45578960 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 8 Mar 2016 21:02:53 +0100 Subject: sync with upstream --- project/cmake/modules/FindCXX11.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 project/cmake/modules/FindCXX11.cmake (limited to 'project/cmake/modules/FindCXX11.cmake') 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 @@ +include(TestCXXAcceptsFlag) + +# try to use compiler flag -std=c++11 +check_cxx_accepts_flag("-std=c++11" CXX_FLAG_CXX11) +if(CXX_FLAG_CXX11) + add_options (CXX ALL_BUILDS "-std=c++11") + set(CXX_STD11_FLAGS "-std=c++11") +else() + # try to use compiler flag -std=c++0x for older compilers + check_cxx_accepts_flag("-std=c++0x" CXX_FLAG_CXX0X) + if(CXX_FLAG_CXX0X) + add_options (CXX ALL_BUILDS "-std=c++0x") + set(CXX_STD11_FLAGS "-std=c++0x") + endif(CXX_FLAG_CXX0X) +endif(CXX_FLAG_CXX11) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS) -- cgit v1.2.3