Use standard CMake C++11 enablement
This commit is contained in:
parent
8052318680
commit
f29c4ff5c5
@ -28,18 +28,8 @@ set(tmux-mem-cpu-load_VERSION
|
|||||||
${tmux-mem-cpu-load_VERSION_MAJOR}.${tmux-mem-cpu-load_VERSION_MINOR}.${tmux-mem-cpu-load_VERSION_PATCH})
|
${tmux-mem-cpu-load_VERSION_MAJOR}.${tmux-mem-cpu-load_VERSION_MINOR}.${tmux-mem-cpu-load_VERSION_PATCH})
|
||||||
|
|
||||||
# Check whether we have support for c++11 in compiler and fail if we don't
|
# Check whether we have support for c++11 in compiler and fail if we don't
|
||||||
include(CheckCXXCompilerFlag)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
|
||||||
|
|
||||||
if(COMPILER_SUPPORTS_CXX11)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
||||||
elseif(COMPILER_SUPPORTS_CXX0X)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"Compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++11 support.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# generate header file to handle version
|
# generate header file to handle version
|
||||||
configure_file(
|
configure_file(
|
||||||
|
Loading…
Reference in New Issue
Block a user