diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index 55ce0b8cfb6..32e00d030b2 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -968,6 +968,7 @@ endif()\n") set(write_implib FALSE) set(write_soname FALSE) set(write_objects FALSE) + set(write_link_dependencies FALSE) set(write_location TRUE) if(target_type STREQUAL "SHARED_LIBRARY") @@ -978,6 +979,7 @@ endif()\n") else() set(write_soname TRUE) endif() + set(write_link_dependencies TRUE) elseif(target_type STREQUAL "OBJECT_LIBRARY") set(write_objects TRUE) set(write_location FALSE) @@ -993,6 +995,9 @@ endif()\n") if(write_soname) string(APPEND content "get_target_property(_qt_imported_soname ${full_target} IMPORTED_SONAME_${uc_release_cfg})\n") endif() + if(write_link_dependencies) + string(APPEND content "get_target_property(_qt_imported_link_dependencies ${full_target} IMPORTED_LINK_DEPENDENT_LIBRARIES_${uc_release_cfg})\n") + endif() if(write_objects) string(APPEND content "get_target_property(_qt_imported_objects ${full_target} IMPORTED_OBJECTS_${uc_release_cfg})\n") # We generate CLR props as well, because that's what CMake generates for object @@ -1009,6 +1014,9 @@ endif()\n") if(write_soname) string(APPEND content "get_target_property(_qt_imported_soname_default ${full_target} IMPORTED_SONAME_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n") endif() + if(write_link_dependencies) + string(APPEND content "get_target_property(_qt_imported_link_dependencies_default ${full_target} IMPORTED_LINK_DEPENDENT_LIBRARIES_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n") + endif() if(write_objects) string(APPEND content "get_target_property(_qt_imported_objects_default ${full_target} IMPORTED_OBJECTS_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n") string(APPEND content "get_target_property(_qt_imported_clr_default ${full_target} IMPORTED_COMMON_LANGUAGE_RUNTIME_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n") @@ -1043,6 +1051,12 @@ endif()") string(APPEND content " if(_qt_imported_soname${var_suffix}) set_property(TARGET ${full_target} PROPERTY IMPORTED_SONAME${property_suffix} \"$\{_qt_imported_soname${var_suffix}}\") +endif()") + endif() + if(write_link_dependencies) + string(APPEND content " +if(_qt_imported_link_dependencies${var_suffix}) + set_property(TARGET ${full_target} PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES${property_suffix} \"$\{_qt_imported_link_dependencies${var_suffix}}\") endif()") endif() if(write_objects) @@ -1065,6 +1079,8 @@ unset(_qt_imported_location) unset(_qt_imported_location_default) unset(_qt_imported_soname) unset(_qt_imported_soname_default) +unset(_qt_imported_link_dependencies) +unset(_qt_imported_link_dependencies_default) unset(_qt_imported_objects) unset(_qt_imported_objects_default) unset(_qt_imported_clr)