2019-06-28 06:57:05 +02:00
|
|
|
macro(use_cxx11)
|
|
|
|
if (CMAKE_VERSION VERSION_LESS "3.1")
|
2022-07-11 10:46:18 +02:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2019-06-28 06:57:05 +02:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
2020-04-22 11:04:19 +02:00
|
|
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2019-06-28 06:57:05 +02:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
endif ()
|
|
|
|
else ()
|
2022-06-12 07:13:42 +02:00
|
|
|
set (CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to use")
|
2021-10-24 11:06:48 +02:00
|
|
|
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
2019-06-28 06:57:05 +02:00
|
|
|
if (POLICY CMP0025)
|
|
|
|
cmake_policy(SET CMP0025 NEW)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
endmacro(use_cxx11)
|