Skip to content

Commit

Permalink
refactor methods to support both modules
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 19, 2021
1 parent cedb625 commit e9c00fd
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 55 deletions.
14 changes: 8 additions & 6 deletions src/auth/basic/gui/CMakeLists.txt
@@ -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}
)
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions src/auth/basic/gui/qgsauthbasicedit.h
Expand Up @@ -18,6 +18,7 @@
#define QGSAUTHBASICEDIT_H

#include <QWidget>

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

Expand Down
19 changes: 19 additions & 0 deletions src/auth/basic/gui/qgsauthbasicmethodgui.cpp
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/auth/esritoken/core/CMakeLists.txt
@@ -1,4 +1,4 @@
set(AUTH_ESRITOKENTOKEN_SRCS
set(AUTH_ESRITOKEN_SRCS
qgsauthesritokenmethod.cpp
)

Expand Down
13 changes: 7 additions & 6 deletions src/auth/esritoken/gui/CMakeLists.txt
@@ -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
)


Expand All @@ -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")
Expand Down
20 changes: 20 additions & 0 deletions src/auth/esritoken/gui/qgsauthesritokenmethodgui.cpp
Expand Up @@ -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;
}
13 changes: 7 additions & 6 deletions src/auth/identcert/gui/CMakeLists.txt
@@ -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)
Expand All @@ -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")
Expand Down
20 changes: 20 additions & 0 deletions src/auth/identcert/gui/qgsauthidentcertmethodgui.cpp
Expand Up @@ -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;
}
13 changes: 8 additions & 5 deletions src/auth/oauth2/core/CMakeLists.txt
Expand Up @@ -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")
Expand All @@ -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)
Expand All @@ -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()
Expand Down
13 changes: 7 additions & 6 deletions src/auth/oauth2/gui/CMakeLists.txt
@@ -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})
Expand All @@ -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}
)

Expand Down
12 changes: 0 additions & 12 deletions src/auth/oauth2/gui/oauth2_resources.qrc

This file was deleted.

20 changes: 20 additions & 0 deletions src/auth/oauth2/gui/qgsauthoauth2methodgui.cpp
Expand Up @@ -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;
}
13 changes: 7 additions & 6 deletions src/auth/pkipaths/gui/CMakeLists.txt
@@ -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)
Expand All @@ -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")
Expand Down
20 changes: 20 additions & 0 deletions src/auth/pkipaths/gui/qgsauthpkipathsmethodgui.cpp
Expand Up @@ -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;
}
14 changes: 8 additions & 6 deletions src/auth/pkipkcs12/gui/CMakeLists.txt
@@ -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
Expand All @@ -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")
Expand Down

0 comments on commit e9c00fd

Please sign in to comment.