From aaf0b72a816ba430442d4ea956db95fa8e286e9f Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 6 Jan 2016 17:37:13 +0100 Subject: [PATCH] CMake: Enable C++11 support on Qt5 targets Implicitly add the minimum required `-std=...` to Qt5 module targets. Use the newly introduced INTERFACE_COMPILE_FEATURES property for this, which is available starting from CMake version 3.1. This also fixes the Qt5 CMake tests, which previously try-compiled projects using Qt 5.7 headers in non-C++11 mode, thus failed. Change-Id: I54fc0e07403b646b5d6ac3ab6b8b47119b4feef6 Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreConfigExtras.cmake.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 65fd1f93838..8242682a897 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -93,6 +93,8 @@ set(Qt5_DISABLED_FEATURES set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) +set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype) + !!IF contains(QT_CONFIG, reduce_exports) set(QT_VISIBILITY_AVAILABLE \"True\") !!ENDIF