summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-03-26 13:39:43 +0100
committerTobias Hunger <tobias.hunger@qt.io>2019-03-27 14:35:56 +0000
commit7406c124cb0c967adba0b4bc02d7b2af6d989fac (patch)
tree9b870947045e1f8654d7cd641ea6d99780b85361 /cmake
parent72404ef3e1e5ad3513986308d26f4af48ba9d28d (diff)
CMake: Set QT_STATICPLUGIN for static plugins
Change-Id: I5439935b5db2babd47cdc85647e464fe845279cf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 0d2c05bbfe..956fbf9ad1 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -713,6 +713,11 @@ function(add_qt_plugin target)
DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS}
)
+ set(static_plugin_define "")
+ if (arg_STATIC OR NOT QT_BUILD_SHARED_LIBS)
+ set(static_plugin_define "QT_STATICPLUGIN")
+ endif()
+
extend_target("${target}"
SOURCES ${arg_SOURCES}
INCLUDE_DIRECTORIES
@@ -731,6 +736,7 @@ function(add_qt_plugin target)
QT_BUILDING_QT
QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore
"${deprecation_define}"
+ "${static_plugin_define}"
QT_PLUGIN
PUBLIC_DEFINES
QT_${module_upper}_LIB
@@ -747,10 +753,6 @@ function(add_qt_plugin target)
MOC_OPTIONS ${arg_MOC_OPTIONS}
)
- if(NOT ${QT_BUILD_SHARED_LIBS})
- extend_target("${target}" DEFINES QT_STATICPLUGIN)
- endif()
-
install(TARGETS "${target}" EXPORT "${target}Targets"
LIBRARY DESTINATION "${install_directory}"
ARCHIVE DESTINATION "${archive_install_directory}")