diff --git a/cmake/windows/helpers.cmake b/cmake/windows/helpers.cmake index 7fa55f5eb..b4d0bf4dd 100644 --- a/cmake/windows/helpers.cmake +++ b/cmake/windows/helpers.cmake @@ -481,6 +481,7 @@ function(_bundle_dependencies target) COMPONENT Runtime ) + set(debug_dll_exceptions qdirect2d qcertonlybackend qopensslbackend qschannelbackend) list(REMOVE_DUPLICATES plugins_list) foreach(plugin IN LISTS plugins_list) message(TRACE "Adding Qt plugin ${plugin}...") @@ -490,12 +491,13 @@ function(_bundle_dependencies target) list(APPEND plugin_stems ${plugin_stem}) - if(plugin MATCHES ".+d\\.dll$") + if(plugin MATCHES "(.+d)\\.dll$" AND CMAKE_MATCH_COUNT EQUAL 1 AND NOT CMAKE_MATCH_1 IN_LIST debug_dll_exceptions) list(APPEND plugin_${plugin_stem}_debug ${plugin}) else() list(APPEND plugin_${plugin_stem} ${plugin}) endif() endforeach() + unset(debug_exceptions) list(REMOVE_DUPLICATES plugin_stems) foreach(stem IN LISTS plugin_stems)