diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 13ebea8b8..426362f9b 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -280,12 +280,19 @@ if (MBGL_QT_STATIC AND NOT MBGL_QT_INSIDE_PLUGIN) $<$>:Qt${QT_VERSION_MAJOR}::Sql> $<$,$>>:z> ) +endif() + +if (MBGL_QT_STATIC OR MBGL_QT_INSIDE_PLUGIN) + # Don't add import/export into public header because we don't build shared library. + # In case on MBGL_QT_INSIDE_PLUGIN it's always OBJECT library and bundled into one + # single Qt plugin lib. target_compile_definitions( qmaplibregl PUBLIC QT_MAPLIBREGL_STATIC ) endif() + install(TARGETS qmaplibregl EXPORT QMapLibreGLTargets # Explicit set of DESTINATION is needed for older CMake versions.