diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 5a604a0c447..f56bfe5cd27 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -3115,6 +3115,10 @@ function(qt_internal_add_plugin target) # but Qt plugins are actually suffixed with .dylib. set_property(TARGET "${target}" PROPERTY SUFFIX ".dylib") endif() + if(WIN32) + # CMake sets for Windows-GNU platforms the suffix "lib" + set_property(TARGET "${target}" PROPERTY PREFIX "") + endif() endif() qt_set_common_target_properties(${target}) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 53a6405aed7..88cdd3ce966 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1211,6 +1211,10 @@ function(qt6_add_plugin target) # but Qt plugins are actually suffixed with .dylib. set_property(TARGET "${target}" PROPERTY SUFFIX ".dylib") endif() + if(WIN32) + # CMake sets for Windows-GNU platforms the suffix "lib" + set_property(TARGET "${target}" PROPERTY PREFIX "") + endif() endif() set(output_name ${target})