Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
Qt
QtDoc
Commits
a390b74a
Commit
a390b74a
authored
9 years ago
by
Liang Qi
Browse files
Options
Download
Plain Diff
Merge remote-tracking branch 'origin/5.4.2' into 5.4
Change-Id: Iecd8ad4a73e8439fb1b372c51c49709f2c513aac
parents
c9c16ae7
9e6aabfd
dev
5.10
5.11
5.12
5.12.1
5.12.10
5.12.11
5.12.12
5.12.2
5.12.3
5.12.4
5.12.5
5.12.6
5.12.7
5.12.8
5.12.9
5.13
5.13.0
5.13.1
5.13.2
5.14
5.14.0
5.14.1
5.14.2
5.15
5.15.0
5.15.1
5.15.2
5.4
5.5
5.6
5.7
5.8
5.9
5.9.8
6.0
6.0.0
6.1
6.1.0
6.1.1
6.1.2
6.1.3
6.2
6.2.0
6.2.1
6.2.2
tqtc/vxworks-5.5
v5.15.0-alpha1
v5.14.1
v5.14.0
v5.14.0-rc2
v5.14.0-rc1
v5.14.0-beta3
v5.14.0-beta2
v5.14.0-beta1
v5.14.0-alpha1
v5.13.2
v5.13.1
v5.13.0
v5.13.0-rc3
v5.13.0-rc2
v5.13.0-rc1
v5.13.0-beta4
v5.13.0-beta3
v5.13.0-beta2
v5.13.0-beta1
v5.13.0-alpha1
v5.12.7
v5.12.6
v5.12.5
v5.12.4
v5.12.3
v5.12.2
v5.12.1
v5.12.0
v5.12.0-rc2
v5.12.0-rc1
v5.12.0-beta4
v5.12.0-beta3
v5.12.0-beta2
v5.12.0-beta1
v5.12.0-alpha1
v5.11.3
v5.11.2
v5.11.1
v5.11.0
v5.11.0-rc2
v5.11.0-rc1
v5.11.0-beta4
v5.11.0-beta3
v5.11.0-beta2
v5.11.0-beta1
v5.11.0-alpha1
v5.10.1
v5.10.0
v5.10.0-rc3
v5.10.0-rc2
v5.10.0-rc1
v5.10.0-beta4
v5.10.0-beta3
v5.10.0-beta2
v5.10.0-beta1
v5.10.0-alpha1
v5.9.9
v5.9.8
v5.9.7
v5.9.6
v5.9.5
v5.9.4
v5.9.3
v5.9.2
v5.9.1
v5.9.0
v5.9.0-rc2
v5.9.0-rc1
v5.9.0-beta4
v5.9.0-beta3
v5.9.0-beta2
v5.9.0-beta1
v5.9.0-alpha1
v5.8.0
v5.8.0-rc1
v5.8.0-beta1
v5.8.0-alpha1
v5.7.1
v5.7.0
v5.7.0-rc1
v5.7.0-beta1
v5.7.0-alpha1
v5.6.3
v5.6.2
v5.6.1
v5.6.1-1
v5.6.0
v5.6.0-rc1
v5.6.0-beta1
v5.6.0-alpha1
v5.5.1
v5.5.0
v5.5.0-rc1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/src/development/cmake-manual.qdoc
+7
-19
doc/src/development/cmake-manual.qdoc
doc/src/snippets/cmake/CMakeLists.pro
+1
-21
doc/src/snippets/cmake/CMakeLists.pro
with
8 additions
and
40 deletions
doc/src/development/cmake-manual.qdoc
+
7
−
19
View file @
a390b74a
...
@@ -96,7 +96,13 @@
...
@@ -96,7 +96,13 @@
associated. They provide a list of plugins in the
associated. They provide a list of plugins in the
\c{Qt5}\e{<Module>}\c{_PLUGINS} variable.
\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
\section2 Using Qt 5 with \c{CMake} older than 2.8.11
...
@@ -124,24 +130,6 @@
...
@@ -124,24 +130,6 @@
\snippet snippets/cmake/CMakeLists.pro 4
\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
\section1 Variable Reference
\section2 Module variables
\section2 Module variables
...
...
This diff is collapsed.
Click to expand it.
doc/src/snippets/cmake/CMakeLists.pro
+
1
−
21
View file @
a390b74a
...
@@ -73,28 +73,8 @@ target_link_libraries(helloworld Qt5::Widgets)
...
@@ -73,28 +73,8 @@ target_link_libraries(helloworld Qt5::Widgets)
#
!
[
4
]
#
!
[
4
]
#
!
[
5
]
#
!
[
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
})
foreach
(
plugin
$
{
Qt5Network_PLUGINS
})
get_target_property
(
_loc
$
{
plugin
}
LOCATION
)
get_target_property
(
_loc
$
{
plugin
}
LOCATION
)
message
(
"Plugin ${plugin} is at location ${_loc}"
)
message
(
"Plugin ${plugin} is at location ${_loc}"
)
endforeach
()
endforeach
()
#
!
[
7
]
#
!
[
5
]
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets