summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-24 15:07:07 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-24 13:30:22 +0000
commita581f917e2043828b032269dd6c8d60f338f3dba (patch)
tree8d0fe22b4738164bea89a9a6b1421367231da010 /cmake
parent1a2a3b72bf8bd3905098d7052287204380e0bfa1 (diff)
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>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 4427d2438b..a07641a9ad 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}")