Skip to content

Commit

Permalink
rename auth methods and providers targets (#43768)
Browse files Browse the repository at this point in the history
* rename auth methods targets

* rename provider targets

* follow up

* fix dll/so lookup

* follow up

* more

* Update qgsauthmethodregistry.cpp

* Update qgsproviderregistry.cpp

* follow up

* fix missing method
  • Loading branch information
3nids committed Jun 19, 2021
1 parent f202c72 commit ad618e7
Show file tree
Hide file tree
Showing 35 changed files with 247 additions and 251 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -217,7 +217,7 @@ if(WITH_CORE)
# The qgis_desktop target is meant to build a minimal but complete running QGIS during development
# This should help to reduce compile time while still having a "complete enough" QGIS for most of the development
add_custom_target(qgis_desktop
DEPENDS qgis qgispython pycore pygui pyanalysis postgresprovider staged-plugins pyplugin-installer resources svg doc icons
DEPENDS qgis qgispython pycore pygui pyanalysis provider_postgres staged-plugins pyplugin-installer resources svg doc icons
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion debian/libqgis-dev.install.in
Expand Up @@ -9,6 +9,6 @@ usr/lib/libqgis_server.so
usr/lib/libqgisgrass?.so
usr/lib/libqgispython.so
usr/share/qgis/FindQGIS.cmake
usr/lib/*/liboauth2authmethod_static.a
usr/lib/*/libauthmethod_oauth2_static.a
#!sid#usr/share/sip/qgis
#sid#usr/lib/python?/*-packages/qgis
10 changes: 5 additions & 5 deletions debian/qgis-providers.install
Expand Up @@ -2,17 +2,17 @@ usr/lib/qgis/crssync
usr/lib/qgis/untwine
usr/lib/qgis/plugins/libarcgisfeatureserverprovider.so
usr/lib/qgis/plugins/libarcgismapserverprovider.so
usr/lib/qgis/plugins/libbasicauthmethod.so
usr/lib/qgis/plugins/libauthmethod_basic.so
usr/lib/qgis/plugins/libdb2provider.so
usr/lib/qgis/plugins/libdelimitedtextprovider.so
usr/lib/qgis/plugins/libesritokenauthmethod.so
usr/lib/qgis/plugins/libauthmethod_esritoken.so
usr/lib/qgis/plugins/libgeonodeprovider.so
usr/lib/qgis/plugins/libgpxprovider.so
usr/lib/qgis/plugins/libidentcertauthmethod.so
usr/lib/qgis/plugins/libauthmethod_identcert.so
usr/lib/qgis/plugins/libmdalprovider.so
usr/lib/qgis/plugins/libmssqlprovider.so
usr/lib/qgis/plugins/libpkcs12authmethod.so
usr/lib/qgis/plugins/libpkipathsauthmethod.so
usr/lib/qgis/plugins/libauthmethod_pkcs12.so
usr/lib/qgis/plugins/libauthmethod_pkipaths.so
usr/lib/qgis/plugins/libpostgresprovider.so
usr/lib/qgis/plugins/libpostgresrasterprovider.so
usr/lib/qgis/plugins/libspatialiteprovider.so
Expand Down
2 changes: 1 addition & 1 deletion debian/qgis.install
@@ -1,6 +1,6 @@
usr/lib/qgis/plugins/libgeometrycheckerplugin.so
usr/lib/qgis/plugins/libgpsimporterplugin.so
usr/lib/qgis/plugins/liboauth2authmethod.so
usr/lib/qgis/plugins/libauthmethod_oauth2.so
usr/lib/qgis/plugins/libofflineeditingplugin.so
usr/lib/qgis/plugins/libtopolplugin.so
usr/share/applications/
Expand Down
16 changes: 8 additions & 8 deletions ms-windows/osgeo4w/package.cmd
Expand Up @@ -291,28 +291,28 @@ for %%i in (%packages%) do (
"apps/%PACKAGENAME%/bin/qgis_native.dll" ^
"apps/%PACKAGENAME%/bin/qgis_process.exe" ^
"apps/%PACKAGENAME%/doc/" ^
"apps/%PACKAGENAME%/plugins/basicauthmethod.dll" ^
"apps/%PACKAGENAME%/plugins/authmethod_basic.dll" ^
"apps/%PACKAGENAME%/plugins/delimitedtextprovider.dll" ^
"apps/%PACKAGENAME%/plugins/esritokenauthmethod.dll" ^
"apps/%PACKAGENAME%/plugins/authmethod_esritoken.dll" ^
"apps/%PACKAGENAME%/plugins/geonodeprovider.dll" ^
"apps/%PACKAGENAME%/plugins/gpxprovider.dll" ^
"apps/%PACKAGENAME%/plugins/identcertauthmethod.dll" ^
"apps/%PACKAGENAME%/plugins/authmethod_identcert.dll" ^
"apps/%PACKAGENAME%/plugins/mssqlprovider.dll" ^
"apps/%PACKAGENAME%/plugins/db2provider.dll" ^
"apps/%PACKAGENAME%/plugins/pkcs12authmethod.dll" ^
"apps/%PACKAGENAME%/plugins/pkipathsauthmethod.dll" ^
"apps/%PACKAGENAME%/plugins/authmethod_pkcs12.dll" ^
"apps/%PACKAGENAME%/plugins/authmethod_pkipaths.dll" ^
"apps/%PACKAGENAME%/plugins/postgresprovider.dll" ^
"apps/%PACKAGENAME%/plugins/postgresrasterprovider.dll" ^
"apps/%PACKAGENAME%/plugins/provider_postgresraster.dll" ^
"apps/%PACKAGENAME%/plugins/spatialiteprovider.dll" ^
"apps/%PACKAGENAME%/plugins/virtuallayerprovider.dll" ^
"apps/%PACKAGENAME%/plugins/wcsprovider.dll" ^
"apps/%PACKAGENAME%/plugins/wfsprovider.dll" ^
"apps/%PACKAGENAME%/plugins/wmsprovider.dll" ^
"apps/%PACKAGENAME%/plugins/arcgismapserverprovider.dll" ^
"apps/%PACKAGENAME%/plugins/arcgisfeatureserverprovider.dll" ^
"apps/%PACKAGENAME%/plugins/provider_arcgisfeatureserver.dll" ^
"apps/%PACKAGENAME%/plugins/mdalprovider.dll" ^
"apps/%PACKAGENAME%/plugins/hanaprovider.dll" ^
"apps/%PACKAGENAME%/plugins/oauth2authmethod.dll" ^
"apps/%PACKAGENAME%/plugins/authmethod_oauth2.dll" ^
"apps/%PACKAGENAME%/resources/qgis.db" ^
"apps/%PACKAGENAME%/resources/spatialite.db" ^
"apps/%PACKAGENAME%/resources/srs.db" ^
Expand Down
6 changes: 3 additions & 3 deletions rpm/qgis.spec.template
Expand Up @@ -127,7 +127,7 @@ BuildRequires: qt5-qt3d-devel

# In F30+ qt5-qtbase-devel has been split
# in qt5-qtbase-devel and qt5-qtbase-private-devel
# qt5-qtbase-private-devel is needed by
# qt5-qtbase-private-devel is needed by
# external/qspatialite/qsql_spatialite.cpp:49:10
%if 0%{?fedora} >= 30
BuildRequires: qt5-qtbase-private-devel
Expand Down Expand Up @@ -316,13 +316,13 @@ rm -f %{buildroot}%{_datadir}/%{name}/doc/INSTALL*
%exclude %{_libdir}/%{name}/plugins/libgrassplugin*.so
%exclude %{_libdir}/%{name}/server/
%exclude %{_libdir}/%{name}/grass/
%exclude %{_prefix}/lib/liboauth2authmethod_static.a
%exclude %{_prefix}/lib/libauthmethod_oauth2_static.a

%files devel
%{_datadir}/%{name}/FindQGIS.cmake
%{_includedir}/%{name}/
%{_libdir}/lib%{name}*.so
%{_prefix}/lib/liboauth2authmethod_static.a
%{_prefix}/lib/lib_authmethod_oauth2_static.a
%{?_qt5_plugindir}/designer/libqgis_customwidgets.so*

%files grass
Expand Down
16 changes: 8 additions & 8 deletions src/auth/basic/CMakeLists.txt
Expand Up @@ -20,28 +20,28 @@ if (WITH_GUI)
QT5_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS})
endif()

add_library(basicauthmethod MODULE ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AUTH_BASIC_UIS_H})
add_library(authmethod_basic MODULE ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AUTH_BASIC_UIS_H})

target_include_directories(basicauthmethod PUBLIC
target_include_directories(authmethod_basic PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/core
)

# require c++17
target_compile_features(basicauthmethod PRIVATE cxx_std_17)
target_compile_features(authmethod_basic PRIVATE cxx_std_17)

target_link_libraries(basicauthmethod qgis_core)
target_link_libraries(authmethod_basic qgis_core)

if (WITH_GUI)
target_include_directories(basicauthmethod PUBLIC
target_include_directories(authmethod_basic PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/gui
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(basicauthmethod qgis_gui)
target_link_libraries(authmethod_basic qgis_gui)
endif()

target_compile_definitions(basicauthmethod PRIVATE "-DQT_NO_FOREACH")
target_compile_definitions(authmethod_basic PRIVATE "-DQT_NO_FOREACH")

install(TARGETS basicauthmethod
install(TARGETS authmethod_basic
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
16 changes: 8 additions & 8 deletions src/auth/esritoken/CMakeLists.txt
Expand Up @@ -20,28 +20,28 @@ if (WITH_GUI)
QT5_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS})
endif()

add_library(esritokenauthmethod MODULE ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKEN_HDRS} ${AUTH_ESRITOKEN_UIS_H})
add_library(authmethod_esritoken MODULE ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKEN_HDRS} ${AUTH_ESRITOKEN_UIS_H})

target_include_directories(esritokenauthmethod PUBLIC
target_include_directories(authmethod_esritoken PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/core
)

# require c++17
target_compile_features(esritokenauthmethod PRIVATE cxx_std_17)
target_compile_features(authmethod_esritoken PRIVATE cxx_std_17)

target_link_libraries(esritokenauthmethod qgis_core)
target_link_libraries(authmethod_esritoken qgis_core)

if (WITH_GUI)
target_include_directories(esritokenauthmethod PUBLIC
target_include_directories(authmethod_esritoken PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/gui
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(esritokenauthmethod qgis_gui)
target_link_libraries(authmethod_esritoken qgis_gui)
endif()

target_compile_definitions(esritokenauthmethod PRIVATE "-DQT_NO_FOREACH")
target_compile_definitions(authmethod_esritoken PRIVATE "-DQT_NO_FOREACH")

install(TARGETS esritokenauthmethod
install(TARGETS authmethod_esritoken
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
18 changes: 9 additions & 9 deletions src/auth/identcert/CMakeLists.txt
Expand Up @@ -20,33 +20,33 @@ if (WITH_GUI)
QT5_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS})
endif()

add_library(identcertauthmethod MODULE ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCERT_HDRS} ${AUTH_IDENTCERT_UIS_H})
add_library(authmethod_identcert MODULE ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCERT_HDRS} ${AUTH_IDENTCERT_UIS_H})

target_include_directories(identcertauthmethod SYSTEM PUBLIC
target_include_directories(authmethod_identcert SYSTEM PUBLIC
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

target_include_directories(identcertauthmethod PUBLIC
target_include_directories(authmethod_identcert PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/core
)

# require c++17
target_compile_features(identcertauthmethod PRIVATE cxx_std_17)
target_compile_features(authmethod_identcert PRIVATE cxx_std_17)

target_link_libraries(identcertauthmethod qgis_core)
target_link_libraries(authmethod_identcert qgis_core)

if (WITH_GUI)
target_include_directories(identcertauthmethod PUBLIC
target_include_directories(authmethod_identcert PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/gui
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(identcertauthmethod qgis_gui)
target_link_libraries(authmethod_identcert qgis_gui)
endif()

target_compile_definitions(identcertauthmethod PRIVATE "-DQT_NO_FOREACH")
target_compile_definitions(authmethod_identcert PRIVATE "-DQT_NO_FOREACH")

install(TARGETS identcertauthmethod
install(TARGETS authmethod_identcert
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
2 changes: 1 addition & 1 deletion src/auth/oauth2/CMakeLists.txt
Expand Up @@ -101,7 +101,7 @@ set(_library_suffix_MODULE "")
set(_library_suffix_STATIC "_static")

foreach(_library_type MODULE STATIC)
set(_library_name "oauth2authmethod${_library_suffix_${_library_type}}")
set(_library_name "authmethod_oauth2${_library_suffix_${_library_type}}")

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

Expand Down
18 changes: 9 additions & 9 deletions src/auth/pkipaths/CMakeLists.txt
Expand Up @@ -20,33 +20,33 @@ if (WITH_GUI)
QT5_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS})
endif()

add_library(pkipathsauthmethod MODULE ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_HDRS} ${AUTH_PKIPATHS_UIS_H})
add_library(authmethod_pkipaths MODULE ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_HDRS} ${AUTH_PKIPATHS_UIS_H})

target_include_directories (pkipathsauthmethod SYSTEM PUBLIC
target_include_directories (authmethod_pkipaths SYSTEM PUBLIC
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

target_include_directories(pkipathsauthmethod PUBLIC
target_include_directories(authmethod_pkipaths PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/core
)

# require c++17
target_compile_features(pkipathsauthmethod PRIVATE cxx_std_17)
target_compile_features(authmethod_pkipaths PRIVATE cxx_std_17)

target_link_libraries(pkipathsauthmethod qgis_core)
target_link_libraries(authmethod_pkipaths qgis_core)

if (WITH_GUI)
target_include_directories(pkipathsauthmethod PUBLIC
target_include_directories(authmethod_pkipaths PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/gui
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(pkipathsauthmethod qgis_gui)
target_link_libraries(authmethod_pkipaths qgis_gui)
endif()

target_compile_definitions(pkipathsauthmethod PRIVATE "-DQT_NO_FOREACH")
target_compile_definitions(authmethod_pkipaths PRIVATE "-DQT_NO_FOREACH")

install(TARGETS pkipathsauthmethod
install(TARGETS authmethod_pkipaths
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
18 changes: 9 additions & 9 deletions src/auth/pkipkcs12/CMakeLists.txt
Expand Up @@ -20,33 +20,33 @@ if (WITH_GUI)
QT5_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS})
endif()

add_library(pkcs12authmethod MODULE ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} ${AUTH_PKCS12_UIS_H})
add_library(authmethod_pkcs12 MODULE ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} ${AUTH_PKCS12_UIS_H})

target_include_directories(pkcs12authmethod SYSTEM PUBLIC
target_include_directories(authmethod_pkcs12 SYSTEM PUBLIC
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
)

target_include_directories(pkcs12authmethod PUBLIC
target_include_directories(authmethod_pkcs12 PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/core
)

# require c++17
target_compile_features(pkcs12authmethod PRIVATE cxx_std_17)
target_compile_features(authmethod_pkcs12 PRIVATE cxx_std_17)

target_link_libraries(pkcs12authmethod qgis_core)
target_link_libraries(authmethod_pkcs12 qgis_core)

if (WITH_GUI)
target_include_directories(pkcs12authmethod PUBLIC
target_include_directories(authmethod_pkcs12 PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/gui
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(pkcs12authmethod qgis_gui)
target_link_libraries(authmethod_pkcs12 qgis_gui)
endif()

target_compile_definitions(pkcs12authmethod PRIVATE "-DQT_NO_FOREACH")
target_compile_definitions(authmethod_pkcs12 PRIVATE "-DQT_NO_FOREACH")

install(TARGETS pkcs12authmethod
install(TARGETS authmethod_pkcs12
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
)
4 changes: 2 additions & 2 deletions src/core/CMakeLists.txt
Expand Up @@ -2021,8 +2021,8 @@ if (FORCE_STATIC_PROVIDERS)
)

target_link_libraries(qgis_core
wmsprovider_a
postgresprovider_a
provider_wms_a
provider_postgres_a
)
endif()

Expand Down
5 changes: 2 additions & 3 deletions src/core/auth/qgsauthmethodregistry.cpp
Expand Up @@ -58,11 +58,10 @@ QgsAuthMethodRegistry::QgsAuthMethodRegistry( const QString &pluginPath )
mLibraryDirectory.setFilter( QDir::Files | QDir::NoSymLinks );

#if defined(Q_OS_WIN) || defined(__CYGWIN__)
mLibraryDirectory.setNameFilters( QStringList( "*authmethod.dll" ) );
mLibraryDirectory.setNameFilters( QStringList( "authmethod_*.dll" ) );
#else
mLibraryDirectory.setNameFilters( QStringList( QStringLiteral( "*authmethod*.so" ) ) );
mLibraryDirectory.setNameFilters( QStringList( QStringLiteral( "*authmethod_*.so" ) ) );
#endif

QgsDebugMsgLevel( QStringLiteral( "Checking for auth method plugins in: %1" ).arg( mLibraryDirectory.path() ), 2 );

if ( mLibraryDirectory.count() == 0 )
Expand Down
2 changes: 1 addition & 1 deletion src/core/providers/qgsproviderregistry.cpp
Expand Up @@ -202,7 +202,7 @@ void QgsProviderRegistry::init()
#if defined(Q_OS_WIN) || defined(__CYGWIN__)
mLibraryDirectory.setNameFilters( QStringList( "*.dll" ) );
#elif defined(ANDROID)
mLibraryDirectory.setNameFilters( QStringList( "*provider*.so" ) );
mLibraryDirectory.setNameFilters( QStringList( "*provider_*.so" ) );
#else
mLibraryDirectory.setNameFilters( QStringList( QStringLiteral( "*.so" ) ) );
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/gui/CMakeLists.txt
Expand Up @@ -1497,8 +1497,8 @@ target_link_libraries(qgis_gui

if (FORCE_STATIC_PROVIDERS)
target_link_libraries(qgis_gui
wmsprovider_gui_a
postgresprovider_gui_a
provider_wms_gui_a
provider_postgres_gui_a
)
endif()

Expand Down

0 comments on commit ad618e7

Please sign in to comment.