summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-11-14 11:24:14 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-11-15 12:25:22 +0000
commitdfc583005b472f6a737bd97f71c0d2d8d0ffea73 (patch)
tree45768ad14c06b6d1eb257770ce8659c28d84c8a3 /cmake
parent7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc (diff)
Fix add_cmake_library to use a correct plugin suffix on macOS
Qt plugins on macOS use .dylib, whereas CMake created used ".so" instead. Change-Id: I3ea73a52a0675a0cfce4997ca413df79e63cfaa7 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 34e824b677..1e5c078eed 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -2678,6 +2678,12 @@ function(qt_add_cmake_library target)
add_library("${target}" MODULE)
set_property(TARGET ${name} PROPERTY C_VISIBILITY_PRESET default)
set_property(TARGET ${name} PROPERTY CXX_VISIBILITY_PRESET default)
+
+ 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()
else()
add_library("${target}")
endif()