From a581f917e2043828b032269dd6c8d60f338f3dba Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 24 Jun 2019 15:07:07 +0200 Subject: [PATCH] Fix plugins on macOS to have the .dylib extension add_library(MODULE) creates libraries with .so extension on macOS, but Qt plugins should have the .dylib extension. Change-Id: I603e7abfb9d5b78c0c8ea526f9fe995bf36c3a50 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 4427d2438ba..a07641a9ad4 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1461,6 +1461,11 @@ function(add_qt_plugin target) add_library("${target}" STATIC) else() add_library("${target}" MODULE) + if(APPLE) + # CMake defaults to using .so extensions for loadable modules, aka plugins, + # but Qt plugins are actually suffixed with .dylib. + set_property(TARGET "${target}" PROPERTY SUFFIX ".dylib") + endif() endif() qt_internal_add_target_aliases("${target}")