Skip to content
Permalink
Browse files
refactor methods to support both modules
  • Loading branch information
3nids committed May 19, 2021
1 parent cedb625 commit e9c00fdf522d6db4243f891b2d37084caca5eddb
@@ -1,17 +1,18 @@
set(AUTH_BASIC_GUI_SRCS}
qgsauthbasicmethodgui.cpp
qgsauthbasicedit.cpp
)
set(AUTH_BASIC_GUI_SRCS
qgsauthbasicmethodgui.cpp
qgsauthbasicedit.cpp
)

set(AUTH_BASIC_GUI_HDRS
qgsauthbasicedit.h
)

set(AUTH_BASIC_GUI_UIS qgsauthbasicedit.ui)
QT5_WRAP_UI(AUTH_BASIC_GUI_UIS_H ${AUTH_BASIC_GUI_UIS})

add_library(basicauthmethodgui MODULE ${AUTH_BASIC_GUI_SRCS} ${AUTH_BASIC_GUI_HDRS} ${AUTH_BASIC_GUI_UIS_H})

target_include_directories(basicauthmethod PUBLIC
target_include_directories(basicauthmethodgui PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
@@ -20,7 +21,8 @@ target_include_directories(basicauthmethod PUBLIC
target_compile_features(basicauthmethodgui PRIVATE cxx_std_17)

target_link_libraries (basicauthmethodgui
qgis_gui
qgis_core
qgis_gui
)

target_compile_definitions(basicauthmethodgui PRIVATE "-DQT_NO_FOREACH")
@@ -18,6 +18,7 @@
#define QGSAUTHBASICEDIT_H

#include <QWidget>

#include "qgsauthmethodedit.h"
#include "ui_qgsauthbasicedit.h"

@@ -16,10 +16,29 @@

#include "qgsauthbasicedit.h"

static const QString AUTH_METHOD_KEY = QStringLiteral( "Basic" );

/**
* Optional class factory to return a pointer to a newly created edit widget
*/
QGISEXTERN QgsAuthBasicEdit *editWidget( QWidget *parent )
{
return new QgsAuthBasicEdit( parent );
}

/**
* Required isAuthMethodGui function. Used to determine if this shared library
* is an authentication method plugin
*/
QGISEXTERN bool isAuthMethodGui()
{
return true;
}

/**
* Required key function (used to map the plugin to a data store type)
*/
QGISEXTERN QString authMethodKey()
{
return AUTH_METHOD_KEY;
}
@@ -1,4 +1,4 @@
set(AUTH_ESRITOKENTOKEN_SRCS
set(AUTH_ESRITOKEN_SRCS
qgsauthesritokenmethod.cpp
)

@@ -1,10 +1,10 @@
set(AUTH_ESRITOKEN_GUI_SRCS}
qgsauthesritokenmethodgui.cpp
qgsauthesritokenedit.cpp
)
set(AUTH_ESRITOKEN_GUI_SRCS
qgsauthesritokenmethodgui.cpp
qgsauthesritokenedit.cpp
)

set(AUTH_ESRITOKEN_GUI_HDRS
qgsauthesritokenedit.h
qgsauthesritokenedit.h
)


@@ -21,7 +21,8 @@ target_include_directories(esritokenauthmethodgui PUBLIC
)

target_link_libraries (esritokenauthmethodgui
qgis_gui
qgis_core
qgis_gui
)

target_compile_definitions(esritokenauthmethodgui PRIVATE "-DQT_NO_FOREACH")
@@ -16,10 +16,30 @@

#include "qgsauthesritokenedit.h"

static const QString AUTH_METHOD_KEY = QStringLiteral( "EsriToken" );


/**
* Optional class factory to return a pointer to a newly created edit widget
*/
QGISEXTERN QgsAuthEsriTokenEdit *editWidget( QWidget *parent )
{
return new QgsAuthEsriTokenEdit( parent );
}

/**
* Required isAuthMethodGui function. Used to determine if this shared library
* is an authentication method plugin
*/
QGISEXTERN bool isAuthMethodGui()
{
return true;
}

/**
* Required key function (used to map the plugin to a data store type)
*/
QGISEXTERN QString authMethodKey()
{
return AUTH_METHOD_KEY;
}
@@ -1,10 +1,10 @@
set(AUTH_IDENTCERT_GUI_SRCS}
qgsauthidentcertmethodgui.cpp
qgsauthidentcertedit.cpp
)
set(AUTH_IDENTCERT_GUI_SRCS
qgsauthidentcertmethodgui.cpp
qgsauthidentcertedit.cpp
)

set(AUTH_IDENTCERT_GUI_HDRS
qgsauthidentcertedit.h
qgsauthidentcertedit.h
)

set(AUTH_IDENTCERT_GUI_UIS qgsauthidentcertedit.ui)
@@ -20,7 +20,8 @@ target_include_directories(identcertauthmethodgui PUBLIC
target_compile_features(identcertauthmethodgui PRIVATE cxx_std_17)

target_link_libraries(identcertauthmethodgui
qgis_gui
qgis_core
qgis_gui
)

target_compile_definitions(identcertauthmethodgui PRIVATE "-DQT_NO_FOREACH")
@@ -16,10 +16,30 @@

#include "qgsauthidentcertedit.h"

static const QString AUTH_METHOD_KEY = QStringLiteral( "Identity-Cert" );


/**
* Optional class factory to return a pointer to a newly created edit widget
*/
QGISEXTERN QgsAuthIdentCertEdit *editWidget( QWidget *parent )
{
return new QgsAuthIdentCertEdit( parent );
}

/**
* Required isAuthMethodGui function. Used to determine if this shared library
* is an authentication method plugin
*/
QGISEXTERN bool isAuthMethodGui()
{
return true;
}

/**
* Required key function (used to map the plugin to a data store type)
*/
QGISEXTERN QString authMethodKey()
{
return AUTH_METHOD_KEY;
}
@@ -56,14 +56,19 @@ set(AUTH_OAUTH2_SRCS
)

set(AUTH_OAUTH2_HDRS
qgsauthoauth2config.h
qgsauthoauth2method.h
qgso2.h
qjsonwrapper/Json.h
)

if(WITH_INTERNAL_O2)
set(OAUTH2_HDRS ${OAUTH2_HDRS} ${O2_HDRS})
set(OAUTH2_SRCS ${OAUTH2_SRCS} ${O2_SRCS})
set(AUTH_OAUTH2_HDRS ${OAUTH2_HDRS} ${O2_HDRS})
set(AUTH_OAUTH2_SRCS ${OAUTH2_SRCS} ${O2_SRCS})
endif()

set(AUTH_OAUTH2_RCCS ../resources/oauth2_resources.qrc)

############################################################
# Generate files
if(WITH_INTERNAL_O2 AND CMAKE_GENERATOR MATCHES "Ninja")
@@ -82,7 +87,7 @@ set(_library_suffix_STATIC "_static")
foreach(_library_type MODULE STATIC)
set(_library_name "oauth2authmethod${_library_suffix_${_library_type}}")

add_library(${_library_name} ${_library_type} ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS})
add_library(${_library_name} ${_library_type} ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS} ${AUTH_OAUTH2_RCCS})

# require c++17
target_compile_features(${_library_name} PRIVATE cxx_std_17)
@@ -95,8 +100,6 @@ foreach(_library_type MODULE STATIC)

target_link_libraries(${_library_name} qgis_core)

target_compile_definitions(${_library_name} PRIVATE "-DQT_NO_FOREACH")

if(WIN32)
add_definitions(-DO2_DLL_EXPORT)
endif()
@@ -1,14 +1,14 @@
set(AUTH_OAUTH2_GUI_SRCS}
qgsauthoauth2methodgui.cpp
qgsauthoauth2edit.cpp
)
set(AUTH_OAUTH2_GUI_SRCS
qgsauthoauth2methodgui.cpp
qgsauthoauth2edit.cpp
)

set(AUTH_OAUTH2_GUI_HDRS
qgsauthoauth2edit.h
qgsauthoauth2edit.h
)

set(AUTH_OAUTH2_GUI_UIS qgsauthoauth2edit.ui)
set(AUTH_OAUTH2_GUI_RCCS oauth2_resources.qrc)
set(AUTH_OAUTH2_GUI_RCCS ../resources/oauth2_resources.qrc)


QT5_WRAP_UI(AUTH_OAUTH2_GUI_UIS_H ${AUTH_OAUTH2_GUI_UIS})
@@ -23,6 +23,7 @@ foreach(_library_type MODULE STATIC)

target_include_directories(${_library_name} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../core
${CMAKE_CURRENT_BINARY_DIR}
)

This file was deleted.

@@ -16,10 +16,30 @@

#include "qgsauthoauth2edit.h"

static const QString AUTH_METHOD_KEY = QStringLiteral( "OAuth2" );


/**
* Optional class factory to return a pointer to a newly created edit widget
*/
QGISEXTERN QgsAuthOAuth2Edit *editWidget( QWidget *parent )
{
return new QgsAuthOAuth2Edit( parent );
}

/**
* Required isAuthMethodGui function. Used to determine if this shared library
* is an authentication method plugin
*/
QGISEXTERN bool isAuthMethodGui()
{
return true;
}

/**
* Required key function (used to map the plugin to a data store type)
*/
QGISEXTERN QString authMethodKey()
{
return AUTH_METHOD_KEY;
}
@@ -1,10 +1,10 @@
set(AUTH_PKIPATHS_GUI_SRCS}
qgsauthpkipathsmethodgui.cpp
qgsauthpkipathsedit.cpp
)
set(AUTH_PKIPATHS_GUI_SRCS
qgsauthpkipathsmethodgui.cpp
qgsauthpkipathsedit.cpp
)

set(AUTH_PKIPATHS_GUI_HDRS
qgsauthpkipathsedit.h
qgsauthpkipathsedit.h
)

set(AUTH_PKIPATHS_GUI_UIS qgsauthpkipathsedit.ui)
@@ -20,7 +20,8 @@ target_include_directories(pkipathsauthmethodgui PUBLIC
target_compile_features(pkipathsauthmethodgui PRIVATE cxx_std_17)

target_link_libraries (pkipathsauthmethodgui
qgis_gui
qgis_core
qgis_gui
)

target_compile_definitions(pkipathsauthmethodgui PRIVATE "-DQT_NO_FOREACH")
@@ -16,10 +16,30 @@

#include "qgsauthpkipathsedit.h"

static const QString AUTH_METHOD_KEY = QStringLiteral( "PKI-Paths" );


/**
* Optional class factory to return a pointer to a newly created edit widget
*/
QGISEXTERN QgsAuthPkiPathsEdit *editWidget( QWidget *parent )
{
return new QgsAuthPkiPathsEdit( parent );
}

/**
* Required isAuthMethodGui function. Used to determine if this shared library
* is an authentication method plugin
*/
QGISEXTERN bool isAuthMethodGui()
{
return true;
}

/**
* Required key function (used to map the plugin to a data store type)
*/
QGISEXTERN QString authMethodKey()
{
return AUTH_METHOD_KEY;
}
@@ -1,14 +1,15 @@
set(AUTH_PKCS12_GUI_SRCS}
qgsauthpkcs12methodgui.cpp
qgsauthpkcs12edit.cpp
)
set(AUTH_PKCS12_GUI_SRCS
qgsauthpkcs12methodgui.cpp
qgsauthpkcs12edit.cpp
)

set(AUTH_PKCS12_GUI_HDRS
qgsauthpkcs12edit.h
qgsauthpkcs12edit.h
)

set(AUTH_PKCS12_GUI_UIS qgsauthpkcs12edit.ui)
QT5_WRAP_UI(AUTH_PKCS12_GUI_UIS_H ${AUTH_PKCS12_GUI_UIS})

add_library(pkcs12authmethodgui MODULE ${AUTH_PKCS12_GUI_SRCS} ${AUTH_PKCS12_GUI_HDRS} ${AUTH_PKCS12_GUI_UIS_H})

target_include_directories(pkcs12authmethodgui PUBLIC
@@ -20,7 +21,8 @@ target_include_directories(pkcs12authmethodgui PUBLIC
target_compile_features(pkcs12authmethodgui PRIVATE cxx_std_17)

target_link_libraries (pkcs12authmethodgui
qgis_gui
qgis_core
qgis_gui
)

target_compile_definitions(pkcs12authmethodgui PRIVATE "-DQT_NO_FOREACH")

0 comments on commit e9c00fd

Please sign in to comment.