Commit cdb2aad7 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Enable C++11

parent 08039c88
......@@ -15,7 +15,9 @@ foreach(p LIB BIN INCLUDE CMAKE)
endforeach()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(cpp11)
add_definitions("-Wall -Wextra -pedantic")
EnableCpp11()
add_library (${PROJECT_NAME} SHARED
src/Media.cpp
......
#Shamelessly taken from http://www.guyrutenberg.com/2014/01/05/enabling-c11-c0x-in-cmake/
macro(EnableCpp11)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
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(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
endmacro()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment