diff --git a/CMakeLists.txt b/CMakeLists.txt index 23734f96309d09df4a705dd1185be18e36c782dc..061ca669abb8974a7b473fc2c42eaa492319289b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,9 +33,14 @@ camitk_opensource_packaging() # Configure CamiTK test coverage report generation (if and only if CAMITK_TEST_COVERAGE is set to TRUE) include(camitk/test/CamiTKTestCoverage) -# From now on, CamiTK is C++11 compliant (this flag is needed for early support of C++11 in g++) -# All target after this declaration wil be compile with c++11 policy -set(CMAKE_CXX_STANDARD 11) +# CamiTK requires C++11 +if(${CMAKE_VERSION} VERSION_LESS "3.1.3") + # CMAKE_CXX_STANDARD not available for cmake 3.0.2 (as in debian old stable) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +else() + # All target after this declaration will be compile with c++11 policy + set(CMAKE_CXX_STANDARD 11) +endif() # Specific to SDK: first compile the SDK (it looks like a CEP but is sooooo special...) add_subdirectory(sdk) diff --git a/sdk/libraries/cepgenerator/resources/cep.CMakeLists.txt.in b/sdk/libraries/cepgenerator/resources/cep.CMakeLists.txt.in index c4be6758cb368c5b7a57b50e9fc6db06191c16fa..693745943ff0edd2510fa05daeb8e10bf176ed8e 100644 --- a/sdk/libraries/cepgenerator/resources/cep.CMakeLists.txt.in +++ b/sdk/libraries/cepgenerator/resources/cep.CMakeLists.txt.in @@ -6,7 +6,14 @@ cmake_minimum_required(VERSION 3.0) # Find CamiTK SDK set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) -set(CMAKE_CXX_STANDARD 11) +# CamiTK requires C++11 +if(${CMAKE_VERSION} VERSION_LESS "3.1.3") + # CMAKE_CXX_STANDARD not available for cmake 3.0.2 (as in debian old stable) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +else() + # All target after this declaration will be compile with c++11 policy + set(CMAKE_CXX_STANDARD 11) +endif() find_package(CamiTK REQUIRED) include(${CAMITK_USE_FILE})