summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-10-12 10:55:56 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-13 01:00:18 +0000
commita96a36a587953abaee64b14ed7aa0d143de47267 (patch)
tree3258f4b1a62fff50d7a04282d23eca39c7e98cbd /cmake
parentba8b039995f6a1850b4f52e2bcde67fbea535be2 (diff)
Fix build with CMake 3.16
Do not read the target property LINK_LIBRARIES from interface libraries as this leads to errors with CMake 3.16. This amends commit 326b91ea788b013512ae911c51cc19497d88916d. Change-Id: I44251c7633d5ecd977cd05746ac311dd1285d1e3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 0098e0ca86b69cfbd89528977dadb2ac3e616eed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtPriHelpers.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake
index 6dd962b575..cb20cfcf43 100644
--- a/cmake/QtPriHelpers.cmake
+++ b/cmake/QtPriHelpers.cmake
@@ -99,10 +99,15 @@ endfunction()
function(qt_get_direct_module_dependencies target out_var)
cmake_parse_arguments(arg "PRIVATE" "" "" ${ARGN})
set(dependencies "")
+ get_target_property(target_type ${target} TYPE)
if(arg_PRIVATE)
- get_target_property(libs ${target} LINK_LIBRARIES)
+ if(target_type STREQUAL "INTERFACE_LIBRARY")
+ set(libs)
+ else()
+ get_target_property(libs ${target} LINK_LIBRARIES)
+ list(REMOVE_DUPLICATES libs)
+ endif()
get_target_property(public_libs ${target} INTERFACE_LINK_LIBRARIES)
- list(REMOVE_DUPLICATES libs)
list(REMOVE_DUPLICATES public_libs)
# Remove all Qt::Foo and Qt6::Foo from libs that also appear in public_libs.
@@ -124,7 +129,6 @@ function(qt_get_direct_module_dependencies target out_var)
if(NOT libs)
set(libs "")
endif()
- get_target_property(target_type ${target} TYPE)
while(libs)
list(POP_FRONT libs lib)
string(GENEX_STRIP "${lib}" lib)