summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Funk <kfunk@kde.org>2016-05-12 10:45:10 +0200
committerKevin Funk <kevin.funk@kdab.com>2016-05-13 14:54:32 +0000
commit525546087f2933d110dbb62785789a853ae29552 (patch)
tree66e87e8b245f92bdd2b3e6b2e268f4d313a09b2a
parent65397e8c9d7a30bd8a07bfa866ded1428532b840 (diff)
downloadqtdoc-525546087f2933d110dbb62785789a853ae29552.tar.gz
CMake: Section about Qt 5.7 and standard versions
Change-Id: Ib1ef76fc37528a6057d7b7ed96353c6a46453b94 Task-Id: QTBUG-53002 Reviewed-by: Stephen Kelly <steveire@gmail.com>
-rw-r--r--doc/src/development/cmake-manual.qdoc8
-rw-r--r--doc/src/snippets/cmake/CMakeLists.pro4
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/src/development/cmake-manual.qdoc b/doc/src/development/cmake-manual.qdoc
index be486c5d..672c838c 100644
--- a/doc/src/development/cmake-manual.qdoc
+++ b/doc/src/development/cmake-manual.qdoc
@@ -105,6 +105,14 @@
\c{CMake} version older than 3.1.0, you need to add the needed \c{-std=...} to the targets
linking against Qt5 modules yourself.
+ If you use Qt 5.7 and a \c{CMake} version above 3.1.0, plus require a more recent C++ standard
+ version, use the CMake way of selecting the standard version, or specify features required and
+ let CMake compute the flags. Example:
+
+ \snippet snippets/cmake/CMakeLists.pro 6
+
+ Also see: \l{https://cmake.org/cmake/help/v3.1/manual/cmake-compile-features.7.html}{CMake cmake-compile-features Documentation}
+
\section2 Using Qt 5 with \c{CMake} older than 2.8.12
It is also necessary when using an older \c{CMake} to add Qt5<Module>_EXECUTABLE_COMPILE_FLAGS to
diff --git a/doc/src/snippets/cmake/CMakeLists.pro b/doc/src/snippets/cmake/CMakeLists.pro
index efdf4226..e938ce88 100644
--- a/doc/src/snippets/cmake/CMakeLists.pro
+++ b/doc/src/snippets/cmake/CMakeLists.pro
@@ -78,3 +78,7 @@ foreach(plugin ${Qt5Network_PLUGINS})
message("Plugin ${plugin} is at location ${_loc}")
endforeach()
#! [5]
+
+#! [6]
+set(CMAKE_CXX_STANDARD 14)
+#! [6]