summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-05-29 09:59:29 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-05-29 09:59:29 +0200
commita390b74a20602dc716f4375a6c33d5d426eba3e6 (patch)
tree09d2748e2f420e3f83abb68b625234fcc02d63b6
parentc9c16ae75238401efc25e440184258c784acf904 (diff)
parent9e6aabfd68771f2fba9288f130dc7db4ace040bf (diff)
Merge remote-tracking branch 'origin/5.4.2' into 5.45.4
-rw-r--r--doc/src/development/cmake-manual.qdoc26
-rw-r--r--doc/src/snippets/cmake/CMakeLists.pro22
2 files changed, 8 insertions, 40 deletions
diff --git a/doc/src/development/cmake-manual.qdoc b/doc/src/development/cmake-manual.qdoc
index 9eab529a4..89c1a457c 100644
--- a/doc/src/development/cmake-manual.qdoc
+++ b/doc/src/development/cmake-manual.qdoc
@@ -96,7 +96,13 @@
associated. They provide a list of plugins in the
\c{Qt5}\e{<Module>}\c{_PLUGINS} variable.
- \snippet snippets/cmake/CMakeLists.pro 7
+ \snippet snippets/cmake/CMakeLists.pro 5
+
+ \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
+ the CMAKE_CXX_FLAGS so that the -fPIC flags are added to the compile flags if necessary (as
+ is the default with Qt 5).
\section2 Using Qt 5 with \c{CMake} older than 2.8.11
@@ -124,24 +130,6 @@
\snippet snippets/cmake/CMakeLists.pro 4
- It is also necessary when using an older \c{CMake} to add Qt5<Module>_EXECUTABLE_COMPILE_FLAGS to
- the CMAKE_CXX_FLAGS so that the -fPIE flags are added to the compile flags if necessary (as
- is the default with Qt 5).
-
- If not using the \c{qt5_use_modules} macro, and if using CMake 2.8.9 or later, the
- \l{CMake POSITION_INDEPENDENT_CODE Documentation}{POSITION_INDEPENDENT_CODE property} can be set on
- targets using Qt instead, or it can be set globally for all targets. Note that this is not necessary
- with CMake 2.8.11:
-
- \snippet snippets/cmake/CMakeLists.pro 5
-
- Note that it may be necessary to enable POSITION_INDEPENDENT_CODE globally in order to use try_compile
- with Qt code, or any wrapper macros around it such as check_cxx_source_compiles etc.
- As position independent code is a platform-specific and Qt-configuration-specific concept, the
- Qt5_POSITION_INDEPENDENT_CODE property can be used to check whether it is required.
-
- \snippet snippets/cmake/CMakeLists.pro 6
-
\section1 Variable Reference
\section2 Module variables
diff --git a/doc/src/snippets/cmake/CMakeLists.pro b/doc/src/snippets/cmake/CMakeLists.pro
index 5600e8703..efdf42266 100644
--- a/doc/src/snippets/cmake/CMakeLists.pro
+++ b/doc/src/snippets/cmake/CMakeLists.pro
@@ -73,28 +73,8 @@ target_link_libraries(helloworld Qt5::Widgets)
#! [4]
#! [5]
-find_package(Qt5Core)
-
-add_executable(exe1 ${exe1_SRCS})
-# Set the POSITION_INDEPENDENT_CODE property for the exe1 target...
-set_target_properties(exe1 PROPERTIES POSITION_INDEPENDENT_CODE ON)
-
-# Or set it globally for all targets:
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-add_executable(exe2 ${exe2_SRCS})
-
-add_executable(exe3 ${exe3_SRCS})
-#! [5]
-
-#! [6]
-if (Qt5_POSITION_INDEPENDENT_CODE)
- set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-endif()
-#! [6]
-
-#! [7]
foreach(plugin ${Qt5Network_PLUGINS})
get_target_property(_loc ${plugin} LOCATION)
message("Plugin ${plugin} is at location ${_loc}")
endforeach()
-#! [7]
+#! [5]