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

Enable C++11

parent 4331c77b
#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()
project(medialibrary)
include(cpp11)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
EnableCpp11()
list(APPEND HEADERS_LIST
${CMAKE_SOURCE_DIR}/include/IAudioTrackInformation.h
${CMAKE_SOURCE_DIR}/include/ITrackInformation.h
......
......@@ -2,6 +2,7 @@ project(medialibrary)
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
include(cpp11)
# Fetch gtest
ExternalProject_Add(
......@@ -24,6 +25,7 @@ include_directories(${source_dir}/include)
ExternalProject_Get_Property(gtest-dependency binary_dir)
link_directories(${binary_dir})
EnableCpp11()
add_definitions("-g")
add_definitions("-Wall -Wextra")
include_directories(${CMAKE_SOURCE_DIR}/include)
......
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