Skip to content
Permalink
Browse files
[afs][ams] Unlick static build support
  • Loading branch information
nirvn authored and github-actions committed Oct 31, 2021
1 parent 6200839 commit 6c59725f67ad0ac82e0d0ade1cfc19474995231d
@@ -2134,6 +2134,8 @@ if (FORCE_STATIC_LIBS)
target_link_libraries(qgis_core
provider_wms_a
provider_delimitedtext_a
provider_arcgisfeatureserver_a
provider_arcgismapserver_a
)
if (HAVE_SPATIALITE)
target_link_libraries(qgis_core
@@ -45,6 +45,8 @@
#ifdef HAVE_STATIC_PROVIDERS
#include "qgswmsprovider.h"
#include "qgsdelimitedtextprovider.h"
#include "qgsafsprovider.h"
#include "qgsamsprovider.h"
#ifdef HAVE_SPATIALITE
#include "qgsspatialiteprovider.h"
#include "qgswfsprovider.h"
@@ -200,6 +202,8 @@ void QgsProviderRegistry::init()
#ifdef HAVE_STATIC_PROVIDERS
mProviders[ QgsWmsProvider::providerKey() ] = new QgsWmsProviderMetadata();
mProviders[ QgsDelimitedTextProvider::providerKey() ] = new QgsDelimitedTextProviderMetadata();
mProviders[ QgsAfsProvider::providerKey() ] = new QgsAfsProviderMetadata();
mProviders[ QgsAmsProvider::providerKey() ] = new QgsAmsProviderMetadata();
#ifdef HAVE_SPATIALITE
mProviders[ QgsSpatiaLiteProvider::providerKey() ] = new QgsSpatiaLiteProviderMetadata();
mProviders[ QgsWFSProvider::providerKey() ] = new QgsWfsProviderMetadata();
@@ -1545,6 +1545,7 @@ if (FORCE_STATIC_LIBS)
target_link_libraries(qgis_gui
provider_wms_gui_a
provider_delimitedtext_gui_a
provider_arcgisfeatureserver_gui_a
)
if (HAVE_SPATIALITE)
target_link_libraries(qgis_gui
@@ -36,6 +36,7 @@
#ifdef HAVE_STATIC_PROVIDERS
#include "qgswmsprovidergui.h"
#include "qgsdelimitedtextprovidergui.h"
#include "qgsarcgisrestprovidergui.h"
#ifdef HAVE_SPATIALITE
#include "qgsspatialiteprovidergui.h"
#include "qgswfsprovidergui.h"
@@ -100,9 +101,10 @@ void QgsProviderGuiRegistry::loadStaticProviders( )
#ifdef HAVE_STATIC_PROVIDERS
QgsProviderGuiMetadata *wms = new QgsWmsProviderGuiMetadata();
mProviders[ wms->key() ] = wms;

QgsProviderGuiMetadata *delimitedtext = new QgsDelimitedTextProviderGuiMetadata();
mProviders[ delimitedtext->key() ] = delimitedtext;
QgsProviderGuiMetadata *arc = new QgsArcGisRestProviderGuiMetadata();
mProviders[ arc->key() ] = arc;
#ifdef HAVE_SPATIALITE
QgsProviderGuiMetadata *spatialite = new QgsSpatiaLiteProviderGuiMetadata();
mProviders[ spatialite->key() ] = spatialite;
@@ -5,6 +5,7 @@ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDI
# providers with implemented both static and dynamic building
add_subdirectory(wms)
add_subdirectory(delimitedtext)
add_subdirectory(arcgisrest)

if (WITH_SPATIALITE)
add_subdirectory(spatialite)
@@ -17,7 +18,6 @@ if (POSTGRES_FOUND)
endif()

if (NOT FORCE_STATIC_LIBS)
add_subdirectory(arcgisrest)
add_subdirectory(geonode)
add_subdirectory(mssql)
add_subdirectory(wcs)
@@ -1,14 +1,3 @@
include_directories(

${CMAKE_BINARY_DIR}/src/ui
)

if (WITH_GUI)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
)
endif()

###############################################################################

set (AFS_SRCS
@@ -18,63 +7,122 @@ set (AFS_SRCS
qgsarcgisrestdataitems.cpp
)
if (WITH_GUI)
set(AFS_SRCS ${AFS_SRCS}
set(AFS_GUI_SRCS
qgsarcgisrestdataitemguiprovider.cpp
qgsarcgisrestprovidergui.cpp
qgsarcgisrestsourceselect.cpp
qgsarcgisrestsourcewidget.cpp
qgsnewarcgisrestconnection.cpp
)

set(AFS_UIS
qgsarcgisrestsourcewidgetbase.ui
qgsarcgisservicesourceselectbase.ui
qgsnewarcgisrestconnectionbase.ui
)
endif()

add_library (provider_arcgisfeatureserver_a STATIC ${AFS_SRCS})
add_library(provider_arcgisfeatureserver MODULE ${AFS_SRCS})

target_include_directories(provider_arcgisfeatureserver_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/arcgisrest
)

# require c++17
target_compile_features(provider_arcgisfeatureserver_a PRIVATE cxx_std_17)
target_compile_features(provider_arcgisfeatureserver PRIVATE cxx_std_17)

target_link_libraries(provider_arcgisfeatureserver
qgis_core
${QCA_LIBRARY}
)

target_link_libraries (provider_arcgisfeatureserver_a
qgis_core
${QCA_LIBRARY}
)

if (WITH_GUI)
target_link_libraries(provider_arcgisfeatureserver
if (WITH_QT6)
QT6_WRAP_UI(AFS_UIS_H ${AFS_UIS})
else()
QT5_WRAP_UI(AFS_UIS_H ${AFS_UIS})
endif()

add_library(provider_arcgisfeatureserver_gui_a STATIC ${AFS_GUI_SRCS} ${AFS_UIS_H})

target_link_libraries(provider_arcgisfeatureserver_gui_a
qgis_gui
)
target_link_libraries(provider_arcgisfeatureserver_a
qgis_gui

include_directories(SYSTEM
${CMAKE_BINARY_DIR}/src/ui
${QSCINTILLA_INCLUDE_DIR}
)
add_dependencies(provider_arcgisfeatureserver ui)
add_dependencies(provider_arcgisfeatureserver_a ui)

add_dependencies(provider_arcgisfeatureserver_gui_a ui)
endif()

install (TARGETS provider_arcgisfeatureserver
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
if (FORCE_STATIC_LIBS)
# for (external) mobile apps to be able to pick up provider for linking
install (TARGETS provider_arcgisfeatureserver_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
if (WITH_GUI)
install (TARGETS provider_arcgisfeatureserver_gui_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
endif()
else()
add_library(provider_arcgisfeatureserver MODULE ${AFS_SRCS} ${AFS_GUI_SRCS} ${AFS_UIS_H})

target_link_libraries(provider_arcgisfeatureserver
qgis_core
${QCA_LIBRARY}
)

# require c++17
target_compile_features(provider_arcgisfeatureserver PRIVATE cxx_std_17)

if (WITH_GUI)
target_link_libraries(provider_arcgisfeatureserver
qgis_gui
)
add_dependencies(provider_arcgisfeatureserver ui)
endif()

install (TARGETS provider_arcgisfeatureserver
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
endif()

###############################################################################

set (AMS_SRCS
qgsamsprovider.cpp
)

add_library(provider_arcgismapserver MODULE ${AMS_SRCS})
add_library (provider_arcgismapserver_a STATIC ${AMS_SRCS})

target_include_directories(provider_arcgismapserver_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/arcgisrest
)

# require c++17
target_compile_features(provider_arcgismapserver PRIVATE cxx_std_17)
target_compile_features(provider_arcgismapserver_a PRIVATE cxx_std_17)

target_link_libraries(provider_arcgismapserver
target_link_libraries (provider_arcgismapserver_a
qgis_core
${QCA_LIBRARY}
)

install (TARGETS provider_arcgismapserver
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
if (FORCE_STATIC_LIBS)
# for (external) mobile apps to be able to pick up provider for linking
install (TARGETS provider_arcgismapserver_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
else()
add_library(provider_arcgismapserver MODULE ${AMS_SRCS})

# require c++17
target_compile_features(provider_arcgismapserver PRIVATE cxx_std_17)

target_link_libraries(provider_arcgismapserver
qgis_core
${QCA_LIBRARY}
)

install (TARGETS provider_arcgismapserver
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
endif()
@@ -353,6 +353,11 @@ QString QgsAfsProvider::name() const
return AFS_PROVIDER_KEY;
}

QString QgsAfsProvider::providerKey()
{
return AFS_PROVIDER_KEY;
}

QString QgsAfsProvider::description() const
{
return AFS_PROVIDER_DESCRIPTION;
@@ -469,7 +474,9 @@ QgsAfsProvider *QgsAfsProviderMetadata::createProvider( const QString &uri, cons
}


#ifndef HAVE_STATIC_PROVIDERS
QGISEXTERN QgsProviderMetadata *providerMetadataFactory()
{
return new QgsAfsProviderMetadata();
}
#endif
@@ -78,6 +78,8 @@ class QgsAfsProvider : public QgsVectorDataProvider
QgsAbstractVectorLayerLabeling *createLabeling( const QVariantMap &configuration = QVariantMap() ) const override;
bool renderInPreview( const QgsDataProvider::PreviewContext &context ) override;

static QString providerKey();

private:
bool mValid = false;
std::shared_ptr<QgsAfsSharedData> mSharedData;
@@ -350,6 +350,8 @@ QgsRasterDataProvider::ProviderCapabilities QgsAmsProvider::providerCapabilities

QString QgsAmsProvider::name() const { return AMS_PROVIDER_KEY; }

QString QgsAmsProvider::providerKey() { return AMS_PROVIDER_KEY; }

QString QgsAmsProvider::description() const { return AMS_PROVIDER_DESCRIPTION; }

QStringList QgsAmsProvider::subLayerStyles() const
@@ -1318,7 +1320,9 @@ QString QgsAmsProviderMetadata::encodeUri( const QVariantMap &parts ) const
return dsUri.uri( false );
}

#ifndef HAVE_STATIC_PROVIDERS
QGISEXTERN QgsProviderMetadata *providerMetadataFactory()
{
return new QgsAmsProviderMetadata();
}
#endif
@@ -88,6 +88,8 @@ class QgsAmsProvider : public QgsRasterDataProvider
bool renderInPreview( const QgsDataProvider::PreviewContext &context ) override;
QgsLayerMetadata layerMetadata() const override;

static QString providerKey();

/* Inherited from QgsRasterInterface */
int bandCount() const override { return 1; }
int capabilities() const override { return Identify | IdentifyText | IdentifyFeature | Prefetch; }
@@ -13,6 +13,8 @@
* *
***************************************************************************/

#include "qgsarcgisrestprovidergui.h"

#include "qgsapplication.h"
#include "qgsproviderguimetadata.h"
#include "qgssourceselectprovider.h"
@@ -63,38 +65,37 @@ class QgsArcGisRestSourceWidgetProvider : public QgsProviderSourceWidgetProvider
}
};

class QgsArcGisRestProviderGuiMetadata: public QgsProviderGuiMetadata

QgsArcGisRestProviderGuiMetadata::QgsArcGisRestProviderGuiMetadata()
: QgsProviderGuiMetadata( QgsAfsProvider::AFS_PROVIDER_KEY )
{
public:
QgsArcGisRestProviderGuiMetadata()
: QgsProviderGuiMetadata( QgsAfsProvider::AFS_PROVIDER_KEY )
{
}
}

QList<QgsDataItemGuiProvider *> dataItemGuiProviders() override
{
QList<QgsDataItemGuiProvider *> providers;
providers << new QgsArcGisRestDataItemGuiProvider();
return providers;
}
QList<QgsDataItemGuiProvider *> QgsArcGisRestProviderGuiMetadata::dataItemGuiProviders() override
{
QList<QgsDataItemGuiProvider *> providers;
providers << new QgsArcGisRestDataItemGuiProvider();
return providers;
}

QList<QgsSourceSelectProvider *> sourceSelectProviders() override
{
QList<QgsSourceSelectProvider *> providers;
providers << new QgsArcGisRestSourceSelectProvider;
return providers;
}
QList<QgsSourceSelectProvider *> QgsArcGisRestProviderGuiMetadata::sourceSelectProviders() override
{
QList<QgsSourceSelectProvider *> providers;
providers << new QgsArcGisRestSourceSelectProvider;
return providers;
}

QList<QgsProviderSourceWidgetProvider *> sourceWidgetProviders() override
{
QList<QgsProviderSourceWidgetProvider *> providers;
providers << new QgsArcGisRestSourceWidgetProvider();
return providers;
}
};
QList<QgsProviderSourceWidgetProvider *> QgsArcGisRestProviderGuiMetadata::sourceWidgetProviders() override
{
QList<QgsProviderSourceWidgetProvider *> providers;
providers << new QgsArcGisRestSourceWidgetProvider();
return providers;
}


#ifndef HAVE_STATIC_PROVIDERS
QGISEXTERN QgsProviderGuiMetadata *providerGuiMetadataFactory()
{
return new QgsArcGisRestProviderGuiMetadata();
}
#endif
@@ -0,0 +1,28 @@
/***************************************************************************
qgsafsprovidergui.h
--------------------------------------
Date : June 2019
Copyright : (C) 2019 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsproviderguimetadata.h"
#include "qgssourceselectprovider.h"
#include "qgsafsprovider.h"

class QgsArcGisRestProviderGuiMetadata: public QgsProviderGuiMetadata
{
public:
QgsArcGisRestProviderGuiMetadata();

QList<QgsDataItemGuiProvider *> dataItemGuiProviders() override;
QList<QgsSourceSelectProvider *> sourceSelectProviders() override;
QList<QgsProviderSourceWidgetProvider *> sourceWidgetProviders() override;
};

0 comments on commit 6c59725

Please sign in to comment.