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 <simon.hausmann@qt.io>
This commit is contained in:
Alexandru Croitor 2019-06-24 15:07:07 +02:00
parent 1a2a3b72bf
commit a581f917e2

View File

@ -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}")