diff --git a/CMakeLists.txt b/CMakeLists.txt index 52a07b34d70..468e5cc517f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,25 +94,19 @@ endif(NOT MSVC) if (IOS) set (DEFAULT_FORCE_STATIC_LIBS TRUE) - set (DEFAULT_FORCE_STATIC_PROVIDERS TRUE) else() set (DEFAULT_FORCE_STATIC_LIBS FALSE) - set (DEFAULT_FORCE_STATIC_PROVIDERS FALSE) endif() set (FORCE_STATIC_LIBS ${DEFAULT_FORCE_STATIC_LIBS} CACHE BOOL "Determines whether libraries should be static only") mark_as_advanced(FORCE_STATIC_LIBS) if (FORCE_STATIC_LIBS) set (LIBRARY_TYPE STATIC) -else() - set (LIBRARY_TYPE SHARED) -endif() - -set (FORCE_STATIC_PROVIDERS ${DEFAULT_FORCE_STATIC_PROVIDERS} CACHE BOOL "Determines whether data providers should be static only") -mark_as_advanced(FORCE_STATIC_PROVIDERS) -if (FORCE_STATIC_PROVIDERS) # following variable is used in qgsconfig.h set (HAVE_STATIC_PROVIDERS TRUE) +else() + set (LIBRARY_TYPE SHARED) + unset(HAVE_STATIC_PROVIDERS) endif() # in generated makefiles use relative paths so the project dir is moveable diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 448682f4b91..c978525e82e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2014,7 +2014,7 @@ if (HAVE_PDAL) ) endif() -if (FORCE_STATIC_PROVIDERS) +if (FORCE_STATIC_LIBS) include_directories( ${CMAKE_SOURCE_DIR}/src/providers/wms ${CMAKE_SOURCE_DIR}/src/providers/postgres diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 0652b63e30e..4f214d7277a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1495,7 +1495,7 @@ target_link_libraries(qgis_gui ${Qt5QuickWidgets_LIBRARIES} ) -if (FORCE_STATIC_PROVIDERS) +if (FORCE_STATIC_LIBS) target_link_libraries(qgis_gui provider_wms_gui_a provider_postgres_gui_a diff --git a/src/gui/qgsproviderguiregistry.h b/src/gui/qgsproviderguiregistry.h index 2c25c75e70f..88e69ba0daf 100644 --- a/src/gui/qgsproviderguiregistry.h +++ b/src/gui/qgsproviderguiregistry.h @@ -120,7 +120,7 @@ class GUI_EXPORT QgsProviderGuiRegistry /** * Loads the dynamic plugins on the given path - * When QGIS is compiled with FORCE_STATIC_PROVIDERS, + * When QGIS is compiled with FORCE_STATIC_LIBS, * the function is no-op */ void loadDynamicProviders( const QString &pluginPath ); diff --git a/src/providers/CMakeLists.txt b/src/providers/CMakeLists.txt index 955d9cab20c..0a7ba0e5467 100644 --- a/src/providers/CMakeLists.txt +++ b/src/providers/CMakeLists.txt @@ -8,7 +8,7 @@ if (POSTGRES_FOUND) add_subdirectory(postgres) endif() -if (NOT FORCE_STATIC_PROVIDERS) +if (NOT FORCE_STATIC_LIBS) add_subdirectory(arcgisrest) add_subdirectory(delimitedtext) add_subdirectory(geonode) diff --git a/src/providers/postgres/CMakeLists.txt b/src/providers/postgres/CMakeLists.txt index 8512083d7fc..fdbac8a50da 100644 --- a/src/providers/postgres/CMakeLists.txt +++ b/src/providers/postgres/CMakeLists.txt @@ -70,12 +70,6 @@ target_compile_features(provider_postgres_a PRIVATE cxx_std_17) target_link_libraries (provider_postgres_a qgis_core ${POSTGRES_LIBRARY} - ${Qt5Xml_LIBRARIES} - ${Qt5Core_LIBRARIES} - ${Qt5Svg_LIBRARIES} - ${Qt5Network_LIBRARIES} - ${Qt5Sql_LIBRARIES} - ${Qt5Concurrent_LIBRARIES} ) if (WITH_GUI) @@ -90,14 +84,6 @@ if (WITH_GUI) qgis_gui provider_postgres_a ${POSTGRES_LIBRARY} - ${Qt5Xml_LIBRARIES} - ${Qt5Core_LIBRARIES} - ${Qt5Svg_LIBRARIES} - ${Qt5Network_LIBRARIES} - ${Qt5Sql_LIBRARIES} - ${Qt5Concurrent_LIBRARIES} - ${Qt5Gui_LIBRARIES} - ${Qt5Widgets_LIBRARIES} ) add_dependencies(provider_postgres_gui_a ui) endif() @@ -141,7 +127,7 @@ endif() ################################################################# -if (FORCE_STATIC_PROVIDERS) +if (FORCE_STATIC_LIBS) # for (external) mobile apps to be able to pick up provider for linking install (TARGETS provider_postgres_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) install (TARGETS provider_postgresraster_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})