From 690e37a8ba340c5806066d7ba9c8c326a70960e9 Mon Sep 17 00:00:00 2001 From: Gerardo Tauriello <gerardo.tauriello@unibas.ch> Date: Wed, 30 Jan 2019 17:46:16 +0100 Subject: [PATCH] Enable C++11 when needed with Qt5. --- cmake_support/OST.cmake | 6 ++++++ modules/doc/install.rst | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake_support/OST.cmake b/cmake_support/OST.cmake index 6826a0c17..8a9e88096 100644 --- a/cmake_support/OST.cmake +++ b/cmake_support/OST.cmake @@ -896,6 +896,12 @@ macro(setup_compiler_flags) # -fno-strict-aliasing set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing" ) endif() + #message(STATUS "GCC VERSION " ${_GCC_VERSION}) + if ((ENABLE_INFO OR ENABLE_GUI) AND _GCC_VERSION LESS "60") + # for older compilers we need to enable C++11 for Qt5 + #message(STATUS "ADDING C++11 FLAG") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() endif() endmacro() set(_BOOST_MIN_VERSION 1.31) diff --git a/modules/doc/install.rst b/modules/doc/install.rst index 54ac0dc74..644cf503e 100644 --- a/modules/doc/install.rst +++ b/modules/doc/install.rst @@ -46,7 +46,7 @@ When you enable support for image processing, you will need: If you would like to use the info module, also install: -* `Qt5 <http://qt-project.org/>`_ +* `Qt5 <http://qt-project.org/>`_ and a C++11 compatible compiler If you would like to use the graphical user interface (GUI), also install: -- GitLab