summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2019-09-24 15:53:41 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2019-09-30 11:14:48 +0000
commit23f19eb869b2eddf9c0cda76cc006266fe8f0396 (patch)
tree205d25035367b226f2d5233f313286e842f4a82a /cmake
parent1daaaf74a63a09702b65676ba18f559d3c6ebc83 (diff)
QtPostProcess: Check target link-type when collecting deps
Fixes a configure issue in qtgamepad Change-Id: I8212d6d58fd2f28ae71a9559cf6544102a873718 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtPostProcess.cmake15
1 files changed, 11 insertions, 4 deletions
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake
index 349d8e131b..ffa367cb9e 100644
--- a/cmake/QtPostProcess.cmake
+++ b/cmake/QtPostProcess.cmake
@@ -12,13 +12,20 @@ function(qt_internal_write_depends_file target)
file(GENERATE OUTPUT "${outfile}" CONTENT "${contents}")
endfunction()
-macro(qt_collect_third_party_deps)
+macro(qt_collect_third_party_deps target)
+ set(_target_is_static OFF)
+ get_target_property(_target_type ${target} TYPE)
+ if (${_target_type} STREQUAL "STATIC_LIBRARY")
+ set(_target_is_static ON)
+ endif()
+ unset(_target_type)
# If we are doing a non-static Qt build, we only want to propagate public dependencies.
# If we are doing a static Qt build, we need to propagate all dependencies.
set(depends_var "public_depends")
- if(NOT QT_BUILD_SHARED_LIBS)
+ if(_target_is_static)
set(depends_var "depends")
endif()
+ unset(_target_is_static)
foreach(dep ${${depends_var}})
# Gather third party packages that should be found when using the Qt module.
@@ -121,7 +128,7 @@ function(qt_internal_create_module_depends_file target)
endif()
endforeach()
- qt_collect_third_party_deps()
+ qt_collect_third_party_deps(${target})
# Add dependency to the main ModuleTool package to ModuleDependencies file.
if(${target} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS)
@@ -203,7 +210,7 @@ function(qt_internal_create_plugin_depends_file target)
get_target_property(target_deps "${target}" _qt_target_deps)
set(target_deps_seen "")
- qt_collect_third_party_deps()
+ qt_collect_third_party_deps(${target})
# Dirty hack because https://gitlab.kitware.com/cmake/cmake/issues/19200
foreach(dep ${target_deps})