summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-12 15:08:24 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-12 14:26:28 +0000
commitfbfa067a304e8aea6ba6719395fd12a05688b6f8 (patch)
tree5725ccb40c6116a54dceef6cf3d0ebbff07edec7 /cmake
parent319fd4ea9ae89874671296c33880805c401844c9 (diff)
Fix static builds
There were a few issues: - Third party dependency info for plugins was not generated, because the depends and public_depends variables were not fetched. This caused issues when trying to use the qcocoa plugin in a consuming application, because Cups::Cups was not found. - Privately linked libraries in extend_target were not considered when generating dependency info for modules. This caused issues in QtThemeSupport, becauese it could not find Qt::DBus, due to that target only being added as a private library in a conditional scope. - Make sure to handle privately linked internal modules like PlatformModuleInternal to map to the Qt5 package, because there is no standalone package for it. Also remove a TODO comment that says that qt_register_target_dependencies should maybe be called in extend_target. That's already the case. Change-Id: Ie99c52e800cd89e6f82008f1e38f4da5cd602929 Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake11
-rw-r--r--cmake/QtPostProcess.cmake2
2 files changed, 9 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 67c80ab2d6..3058e22bb5 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -766,12 +766,13 @@ function(qt_register_target_dependencies target public_libs private_libs)
set(target_deps "")
endif()
- # TODO: should this also be in extend_target ? From the looks of it I would say that
- # it is not necessary but I'm not sure
foreach(lib IN LISTS public_libs private_libs)
if ("${lib}" MATCHES "^Qt::(.*)")
set(lib "${CMAKE_MATCH_1}")
- if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig)
+ if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig
+ OR lib STREQUAL PlatformModuleInternal
+ OR lib STREQUAL PlatformPluginInternal
+ OR lib STREQUAL PlatformToolInternal)
list(APPEND target_deps "Qt5\;${PROJECT_VERSION}")
elseif ("${lib}" MATCHES "(.*)Private")
list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${CMAKE_MATCH_1}\;${PROJECT_VERSION}")
@@ -871,7 +872,9 @@ function(extend_target target)
if(TARGET "${target_private}")
target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}")
endif()
- qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}")
+ qt_register_target_dependencies("${target}"
+ "${arg_PUBLIC_LIBRARIES}"
+ "${qt_libs_private};${arg_LIBRARIES}")
qt_autogen_tools(${target}
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake
index dc16514825..568719d4f0 100644
--- a/cmake/QtPostProcess.cmake
+++ b/cmake/QtPostProcess.cmake
@@ -171,6 +171,8 @@ endfunction()
function(qt_internal_create_plugin_depends_file target)
get_target_property(qt_module "${target}" QT_MODULE)
+ get_target_property(depends "${target}" LINK_LIBRARIES)
+ get_target_property(public_depends "${target}" INTERFACE_LINK_LIBRARIES)
get_target_property(target_deps "${target}" _qt_target_deps)
set(target_deps_seen "")