diff --git a/cmake/FindQt5.cmake b/cmake/FindQt5.cmake index b64f3bdb178..fc16ec17237 100644 --- a/cmake/FindQt5.cmake +++ b/cmake/FindQt5.cmake @@ -61,13 +61,13 @@ set(__additional_imported_components ATSPI2_nolink) # Work around QTBUG-97023 foreach(comp IN LISTS Qt5_FIND_COMPONENTS __additional_imported_components) if(TARGET Qt6::${comp}) if (NOT TARGET Qt5::${comp}) - if (QT_BUILD_SHARED_LIBS) + if (NOT QT_FEATURE_static) set_property(TARGET Qt6::${comp} PROPERTY IMPORTED_GLOBAL TRUE) endif() add_library(Qt5::${comp} ALIAS Qt6::${comp}) endif() if (TARGET Qt6::${comp}Private AND NOT TARGET Qt5::${comp}Private) - if (QT_BUILD_SHARED_LIBS) + if (NOT QT_FEATURE_static) set_property(TARGET Qt6::${comp}Private PROPERTY IMPORTED_GLOBAL TRUE) endif() add_library(Qt5::${comp}Private ALIAS Qt6::${comp}Private)