From 6c805274687651347b4932a504f2f4cd92af21e0 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 10:17:16 +0100 Subject: [PATCH 01/10] Use versionless QT_WRAP_UI --- src/auth/apiheader/CMakeLists.txt | 6 +- src/auth/awss3/CMakeLists.txt | 6 +- src/auth/basic/CMakeLists.txt | 6 +- src/auth/esritoken/CMakeLists.txt | 6 +- src/auth/identcert/CMakeLists.txt | 6 +- src/auth/maptiler_hmacsha256/CMakeLists.txt | 6 +- src/auth/oauth2/CMakeLists.txt | 6 +- src/auth/pkipaths/CMakeLists.txt | 6 +- src/auth/pkipkcs12/CMakeLists.txt | 6 +- src/crashhandler/CMakeLists.txt | 6 +- src/plugins/geometry_checker/CMakeLists.txt | 6 +- src/plugins/grass/CMakeLists.txt | 6 +- src/plugins/offline_editing/CMakeLists.txt | 6 +- src/plugins/topology/CMakeLists.txt | 6 +- src/providers/arcgisrest/CMakeLists.txt | 6 +- src/providers/delimitedtext/CMakeLists.txt | 6 +- src/providers/grass/CMakeLists.txt | 11 +--- src/providers/postgres/CMakeLists.txt | 6 +- src/providers/spatialite/CMakeLists.txt | 6 +- src/providers/virtual/CMakeLists.txt | 6 +- src/providers/wfs/CMakeLists.txt | 6 +- src/providers/wms/CMakeLists.txt | 6 +- src/ui/CMakeLists.txt | 72 +++++++-------------- 23 files changed, 45 insertions(+), 164 deletions(-) diff --git a/src/auth/apiheader/CMakeLists.txt b/src/auth/apiheader/CMakeLists.txt index 35bb52c345e8..25e9a8ef81cc 100644 --- a/src/auth/apiheader/CMakeLists.txt +++ b/src/auth/apiheader/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthapiheaderedit.h ) set(AUTH_APIHEADER_UIS gui/qgsauthapiheaderedit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_APIHEADER_UIS_H ${AUTH_APIHEADER_UIS}) - else() - QT5_WRAP_UI(AUTH_APIHEADER_UIS_H ${AUTH_APIHEADER_UIS}) - endif() + qt_wrap_ui(AUTH_APIHEADER_UIS_H ${AUTH_APIHEADER_UIS}) endif() diff --git a/src/auth/awss3/CMakeLists.txt b/src/auth/awss3/CMakeLists.txt index 47ba61a9e52e..f56742ffe253 100644 --- a/src/auth/awss3/CMakeLists.txt +++ b/src/auth/awss3/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthawss3edit.h ) set(AUTH_AWSS3_UIS gui/qgsauthawss3edit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_AWSS3_UIS_H ${AUTH_AWSS3_UIS}) - else() - QT5_WRAP_UI(AUTH_AWSS3_UIS_H ${AUTH_AWSS3_UIS}) - endif() + qt_wrap_ui(AUTH_AWSS3_UIS_H ${AUTH_AWSS3_UIS}) endif() diff --git a/src/auth/basic/CMakeLists.txt b/src/auth/basic/CMakeLists.txt index 6b4f59ed248a..53034b6e26d1 100644 --- a/src/auth/basic/CMakeLists.txt +++ b/src/auth/basic/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthbasicedit.h ) set(AUTH_BASIC_UIS gui/qgsauthbasicedit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS}) - else() - QT5_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS}) - endif() + qt_wrap_ui(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS}) endif() diff --git a/src/auth/esritoken/CMakeLists.txt b/src/auth/esritoken/CMakeLists.txt index 5bc3f1fb681b..1a1dce803462 100644 --- a/src/auth/esritoken/CMakeLists.txt +++ b/src/auth/esritoken/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthesritokenedit.h ) set(AUTH_ESRITOKEN_UIS gui/qgsauthesritokenedit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS}) - else() - QT5_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS}) - endif() + qt_wrap_ui(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS}) endif() diff --git a/src/auth/identcert/CMakeLists.txt b/src/auth/identcert/CMakeLists.txt index f6dda60f06c7..371a93d8541d 100644 --- a/src/auth/identcert/CMakeLists.txt +++ b/src/auth/identcert/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthidentcertedit.h ) set(AUTH_IDENTCERT_UIS gui/qgsauthidentcertedit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS}) - else() - QT5_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS}) - endif() + qt_wrap_ui(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS}) endif() diff --git a/src/auth/maptiler_hmacsha256/CMakeLists.txt b/src/auth/maptiler_hmacsha256/CMakeLists.txt index 5e7b988f82b2..54102aadaf8e 100644 --- a/src/auth/maptiler_hmacsha256/CMakeLists.txt +++ b/src/auth/maptiler_hmacsha256/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthmaptilerhmacsha256edit.h ) set(AUTH_MAPTILER_HMACSHA256_UIS gui/qgsauthmaptilerhmacsha256edit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_MAPTILER_HMACSHA256_UIS_H ${AUTH_MAPTILER_HMACSHA256_UIS}) - else() - QT5_WRAP_UI(AUTH_MAPTILER_HMACSHA256_UIS_H ${AUTH_MAPTILER_HMACSHA256_UIS}) - endif() + qt_wrap_ui(AUTH_MAPTILER_HMACSHA256_UIS_H ${AUTH_MAPTILER_HMACSHA256_UIS}) endif() diff --git a/src/auth/oauth2/CMakeLists.txt b/src/auth/oauth2/CMakeLists.txt index a4348cf48f5d..71c9117b2fc6 100644 --- a/src/auth/oauth2/CMakeLists.txt +++ b/src/auth/oauth2/CMakeLists.txt @@ -84,11 +84,7 @@ if (WITH_GUI) ) set(AUTH_OAUTH2_UIS gui/qgsauthoauth2edit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_OAUTH2_UIS_H ${AUTH_OAUTH2_UIS}) - else() - QT5_WRAP_UI(AUTH_OAUTH2_UIS_H ${AUTH_OAUTH2_UIS}) - endif() + qt_wrap_ui(AUTH_OAUTH2_UIS_H ${AUTH_OAUTH2_UIS}) endif() diff --git a/src/auth/pkipaths/CMakeLists.txt b/src/auth/pkipaths/CMakeLists.txt index 8878344dc590..e8a605abec00 100644 --- a/src/auth/pkipaths/CMakeLists.txt +++ b/src/auth/pkipaths/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthpkipathsedit.h ) set(AUTH_PKIPATHS_UIS gui/qgsauthpkipathsedit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS}) - else() - QT5_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS}) - endif() + qt_wrap_ui(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS}) endif() # static library diff --git a/src/auth/pkipkcs12/CMakeLists.txt b/src/auth/pkipkcs12/CMakeLists.txt index 3e0b8e9e6ce1..7f362ff68303 100644 --- a/src/auth/pkipkcs12/CMakeLists.txt +++ b/src/auth/pkipkcs12/CMakeLists.txt @@ -16,11 +16,7 @@ if (WITH_GUI) gui/qgsauthpkcs12edit.h ) set(AUTH_PKCS12_UIS gui/qgsauthpkcs12edit.ui) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS}) - else() - QT5_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS}) - endif() + qt_wrap_ui(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS}) endif() # static library diff --git a/src/crashhandler/CMakeLists.txt b/src/crashhandler/CMakeLists.txt index 55689fa01d31..f0b7635b1a1a 100644 --- a/src/crashhandler/CMakeLists.txt +++ b/src/crashhandler/CMakeLists.txt @@ -2,11 +2,7 @@ include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR} ) -if (BUILD_WITH_QT6) - QT6_WRAP_UI(CRASH_UIS_H qgscrashdialog.ui) -else() - QT5_WRAP_UI(CRASH_UIS_H qgscrashdialog.ui) -endif() +qt_wrap_ui(CRASH_UIS_H qgscrashdialog.ui) set(IMAGE_RCCS ../../images/images.qrc) diff --git a/src/plugins/geometry_checker/CMakeLists.txt b/src/plugins/geometry_checker/CMakeLists.txt index 5b77d208dc8c..43f1d2b93c4a 100644 --- a/src/plugins/geometry_checker/CMakeLists.txt +++ b/src/plugins/geometry_checker/CMakeLists.txt @@ -30,11 +30,7 @@ set (geometrychecker_RCCS ######################################################## # Build -if (BUILD_WITH_QT6) - QT6_WRAP_UI (geometrychecker_UIS_H ${geometrychecker_UIS}) -else() - QT5_WRAP_UI (geometrychecker_UIS_H ${geometrychecker_UIS}) -endif() +qt_wrap_ui(geometrychecker_UIS_H ${geometrychecker_UIS}) add_library (plugin_geometrychecker MODULE ${geometrychecker_SRCS} ${geometrychecker_RCCS} ${geometrychecker_UIS_H}) diff --git a/src/plugins/grass/CMakeLists.txt b/src/plugins/grass/CMakeLists.txt index 88168bb0d38f..21ef3d47c86c 100644 --- a/src/plugins/grass/CMakeLists.txt +++ b/src/plugins/grass/CMakeLists.txt @@ -90,11 +90,7 @@ macro(ADD_GRASSPLUGIN GRASS_BUILD_VERSION) set(GRASS_MAJOR_VERSION ${GRASS_MAJOR_VERSION${GRASS_BUILD_VERSION}}) set(GRASS_MINOR_VERSION ${GRASS_MINOR_VERSION${GRASS_BUILD_VERSION}}) - if (BUILD_WITH_QT6) - QT6_WRAP_UI (GRASS_PLUGIN_UIS_H ${GRASS_PLUGIN_UIS}) - else() - QT5_WRAP_UI (GRASS_PLUGIN_UIS_H ${GRASS_PLUGIN_UIS}) - endif() + qt_wrap_ui(GRASS_PLUGIN_UIS_H ${GRASS_PLUGIN_UIS}) include_directories( ${CMAKE_BINARY_DIR}/src/providers/grass/${GRASS_BUILD_VERSION} diff --git a/src/plugins/offline_editing/CMakeLists.txt b/src/plugins/offline_editing/CMakeLists.txt index c7ca21558d36..71850112e8f6 100644 --- a/src/plugins/offline_editing/CMakeLists.txt +++ b/src/plugins/offline_editing/CMakeLists.txt @@ -18,11 +18,7 @@ set (offline_editing_plugin_RCCS offline_editing_plugin.qrc) ######################################################## # Build -if (BUILD_WITH_QT6) - QT6_WRAP_UI(offline_editing_plugin_UIS_H ${offline_editing_plugin_UIS}) -else() - QT5_WRAP_UI(offline_editing_plugin_UIS_H ${offline_editing_plugin_UIS}) -endif() +qt_wrap_ui(offline_editing_plugin_UIS_H ${offline_editing_plugin_UIS}) add_library (plugin_offlineediting MODULE ${offline_editing_plugin_SRCS} diff --git a/src/plugins/topology/CMakeLists.txt b/src/plugins/topology/CMakeLists.txt index 30252940bd48..4c10bd0e0b54 100644 --- a/src/plugins/topology/CMakeLists.txt +++ b/src/plugins/topology/CMakeLists.txt @@ -21,11 +21,7 @@ set (topol_RCCS topol.qrc) ######################################################## # Build -if (BUILD_WITH_QT6) - QT6_WRAP_UI (topol_UIS_H ${topol_UIS}) -else() - QT5_WRAP_UI (topol_UIS_H ${topol_UIS}) -endif() +qt_wrap_ui(topol_UIS_H ${topol_UIS}) add_library (plugin_topology MODULE ${topol_SRCS} ${topol_RCCS} ${topol_UIS_H}) diff --git a/src/providers/arcgisrest/CMakeLists.txt b/src/providers/arcgisrest/CMakeLists.txt index 0849bdeca499..6f95aefd1b23 100644 --- a/src/providers/arcgisrest/CMakeLists.txt +++ b/src/providers/arcgisrest/CMakeLists.txt @@ -42,11 +42,7 @@ target_link_libraries (provider_arcgisfeatureserver_a ) if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(AFS_UIS_H ${AFS_UIS}) - else() - QT5_WRAP_UI(AFS_UIS_H ${AFS_UIS}) - endif() + qt_wrap_ui(AFS_UIS_H ${AFS_UIS}) add_library(provider_arcgisfeatureserver_gui_a STATIC ${AFS_GUI_SRCS} ${AFS_UIS_H}) diff --git a/src/providers/delimitedtext/CMakeLists.txt b/src/providers/delimitedtext/CMakeLists.txt index c0af254b3da4..5d70641a9e99 100644 --- a/src/providers/delimitedtext/CMakeLists.txt +++ b/src/providers/delimitedtext/CMakeLists.txt @@ -30,11 +30,7 @@ target_compile_features(provider_delimitedtext_a PRIVATE cxx_std_17) target_compile_definitions(provider_delimitedtext_a PRIVATE "-DQT_NO_FOREACH") if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(DTEXT_UIS_H ${DTEXT_UIS}) - else() - QT5_WRAP_UI(DTEXT_UIS_H ${DTEXT_UIS}) - endif() + qt_wrap_ui(DTEXT_UIS_H ${DTEXT_UIS}) add_library(provider_delimitedtext_gui_a STATIC ${DTEXT_GUI_SRCS} ${DTEXT_UIS_H}) diff --git a/src/providers/grass/CMakeLists.txt b/src/providers/grass/CMakeLists.txt index 943a95958cf0..41d162c4812d 100644 --- a/src/providers/grass/CMakeLists.txt +++ b/src/providers/grass/CMakeLists.txt @@ -59,16 +59,7 @@ macro(ADD_GRASSLIB GRASS_BUILD_VERSION) ) endif() - if (BUILD_WITH_QT6) - QT6_WRAP_UI (GRASS_LIBRARY_UIS_H - ../qgsgrassoptionsbase.ui - ) - else() - QT5_WRAP_UI (GRASS_LIBRARY_UIS_H - ../qgsgrassoptionsbase.ui - ) - endif() - + qt_wrap_ui(GRASS_LIBRARY_UIS_H ../qgsgrassoptionsbase.ui) add_library(qgisgrass${GRASS_BUILD_VERSION} SHARED ${GRASS_LIBRARY_SRCS} diff --git a/src/providers/postgres/CMakeLists.txt b/src/providers/postgres/CMakeLists.txt index 64a2287a01b7..42e82b190b2f 100644 --- a/src/providers/postgres/CMakeLists.txt +++ b/src/providers/postgres/CMakeLists.txt @@ -62,11 +62,7 @@ target_link_libraries (provider_postgres_a ) if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(PG_UIS_H ${PG_UIS}) - else() - QT5_WRAP_UI(PG_UIS_H ${PG_UIS}) - endif() + qt_wrap_ui(PG_UIS_H ${PG_UIS}) add_library(provider_postgres_gui_a STATIC ${PG_GUI_SRCS} ${PG_UIS_H}) diff --git a/src/providers/spatialite/CMakeLists.txt b/src/providers/spatialite/CMakeLists.txt index fd61cb552896..690d07263435 100644 --- a/src/providers/spatialite/CMakeLists.txt +++ b/src/providers/spatialite/CMakeLists.txt @@ -50,11 +50,7 @@ target_compile_definitions(provider_spatialite_a PRIVATE "CMAKE_SOURCE_DIR=\"${C target_compile_definitions(provider_spatialite_a PRIVATE "-DQT_NO_FOREACH") if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(SPATIALITE_UIS_H ${SPATIALITE_UIS}) - else() - QT5_WRAP_UI(SPATIALITE_UIS_H ${SPATIALITE_UIS}) - endif() + qt_wrap_ui(SPATIALITE_UIS_H ${SPATIALITE_UIS}) add_library(provider_spatialite_gui_a STATIC ${SPATIALITE_GUI_SRCS} ${SPATIALITE_UIS_H}) diff --git a/src/providers/virtual/CMakeLists.txt b/src/providers/virtual/CMakeLists.txt index 524740624c32..a6f1242c7127 100644 --- a/src/providers/virtual/CMakeLists.txt +++ b/src/providers/virtual/CMakeLists.txt @@ -48,11 +48,7 @@ target_compile_features(provider_virtuallayer_a PRIVATE cxx_std_17) target_compile_definitions(provider_virtuallayer_a PRIVATE "-DQT_NO_FOREACH") if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(VLAYER_PROVIDER_UIS_H qgsvirtuallayersourceselectbase.ui qgsembeddedlayerselect.ui) - else() - QT5_WRAP_UI(VLAYER_PROVIDER_UIS_H qgsvirtuallayersourceselectbase.ui qgsembeddedlayerselect.ui) - endif() + qt_wrap_ui(VLAYER_PROVIDER_UIS_H qgsvirtuallayersourceselectbase.ui qgsembeddedlayerselect.ui) add_library(provider_virtuallayer_gui_a STATIC ${VLAYER_PROVIDER_GUI_SRCS} ${VLAYER_PROVIDER_GUI_HDRS} ${VLAYER_PROVIDER_UIS_H}) target_include_directories(provider_virtuallayer_gui_a PUBLIC diff --git a/src/providers/wfs/CMakeLists.txt b/src/providers/wfs/CMakeLists.txt index 89c12074aa60..62cec8b2e89f 100644 --- a/src/providers/wfs/CMakeLists.txt +++ b/src/providers/wfs/CMakeLists.txt @@ -77,11 +77,7 @@ target_compile_definitions(provider_wfs_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SO target_compile_definitions(provider_wfs_a PRIVATE "-DQT_NO_FOREACH") if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(WFS_UIS_H ${WFS_UIS}) - else() - QT5_WRAP_UI(WFS_UIS_H ${WFS_UIS}) - endif() + qt_wrap_ui(WFS_UIS_H ${WFS_UIS}) add_library(provider_wfs_gui_a STATIC ${WFS_GUI_SRCS} ${WFS_UIS_H}) diff --git a/src/providers/wms/CMakeLists.txt b/src/providers/wms/CMakeLists.txt index be95dc4eab02..99c8debdaa9d 100644 --- a/src/providers/wms/CMakeLists.txt +++ b/src/providers/wms/CMakeLists.txt @@ -35,11 +35,7 @@ target_include_directories(provider_wms_a PUBLIC target_compile_features(provider_wms_a PRIVATE cxx_std_17) if (WITH_GUI) - if (BUILD_WITH_QT6) - QT6_WRAP_UI(WMS_UIS_H ${WMS_UIS}) - else() - QT5_WRAP_UI(WMS_UIS_H ${WMS_UIS}) - endif() + qt_wrap_ui(WMS_UIS_H ${WMS_UIS}) add_library(provider_wms_gui_a STATIC ${WMS_GUI_SRCS} ${WMS_UIS_H}) diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index d89d204dc362..159c0f1ee523 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -21,55 +21,29 @@ file(GLOB SENSOR_UIS "${CMAKE_CURRENT_SOURCE_DIR}/sensor/*.ui") file(GLOB TILED_SCENE_UIS "${CMAKE_CURRENT_SOURCE_DIR}/tiledscene/*.ui") file(GLOB STAC_UIS "${CMAKE_CURRENT_SOURCE_DIR}/stac/*.ui") -if (BUILD_WITH_QT6) - QT6_WRAP_UI(QGIS_UIS_H - ${QGIS_UIS} - ${SYMBOLLAYER_UIS} - ${EDITORWIDGET_UIS} - ${PAINTEFFECT_UIS} - ${PROCESSING_UIS} - ${AUTH_UIS} - ${RASTER_UIS} - ${STYLEDOCK_UIS} - ${LAYOUT_UIS} - ${MESH_UIS} - ${POINTCLOUD_UIS} - ${_3D_UIS} - ${CALLOUT_UIS} - ${LABELING_UIS} - ${NUMERICFORMAT_UIS} - ${ATTRIBUTEFORMCONFIG_UIS} - ${GEOREFERENCER_UIS} - ${ANNOTATION_UIS} - ${SENSOR_UIS} - ${TILED_SCENE_UIS} - ${STAC_UIS} - ) -else() - QT5_WRAP_UI(QGIS_UIS_H - ${QGIS_UIS} - ${SYMBOLLAYER_UIS} - ${EDITORWIDGET_UIS} - ${PAINTEFFECT_UIS} - ${PROCESSING_UIS} - ${AUTH_UIS} - ${RASTER_UIS} - ${STYLEDOCK_UIS} - ${LAYOUT_UIS} - ${MESH_UIS} - ${POINTCLOUD_UIS} - ${_3D_UIS} - ${CALLOUT_UIS} - ${LABELING_UIS} - ${NUMERICFORMAT_UIS} - ${ATTRIBUTEFORMCONFIG_UIS} - ${GEOREFERENCER_UIS} - ${ANNOTATION_UIS} - ${SENSOR_UIS} - ${TILED_SCENE_UIS} - ${STAC_UIS} - ) -endif() +qt_wrap_ui(QGIS_UIS_H + ${QGIS_UIS} + ${SYMBOLLAYER_UIS} + ${EDITORWIDGET_UIS} + ${PAINTEFFECT_UIS} + ${PROCESSING_UIS} + ${AUTH_UIS} + ${RASTER_UIS} + ${STYLEDOCK_UIS} + ${LAYOUT_UIS} + ${MESH_UIS} + ${POINTCLOUD_UIS} + ${_3D_UIS} + ${CALLOUT_UIS} + ${LABELING_UIS} + ${NUMERICFORMAT_UIS} + ${ATTRIBUTEFORMCONFIG_UIS} + ${GEOREFERENCER_UIS} + ${ANNOTATION_UIS} + ${SENSOR_UIS} + ${TILED_SCENE_UIS} + ${STAC_UIS} +) set(QGIS_GUI_UI_HDRS ${QGIS_UIS_H} PARENT_SCOPE) From 2b89189591d1b8bc80158d3e68522b7bee36548c Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 10:18:52 +0100 Subject: [PATCH 02/10] User versionless QT_WRAP_CPP --- tests/src/quickgui/app/CMakeLists.txt | 6 +----- tests/src/server/wfs/CMakeLists.txt | 6 +----- tests/src/server/wms/CMakeLists.txt | 8 ++------ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/src/quickgui/app/CMakeLists.txt b/tests/src/quickgui/app/CMakeLists.txt index d61939d5a48c..5dd14ac21461 100644 --- a/tests/src/quickgui/app/CMakeLists.txt +++ b/tests/src/quickgui/app/CMakeLists.txt @@ -27,11 +27,7 @@ include_directories(SYSTEM ${QTKEYCHAIN_INCLUDE_DIR} ) -if (BUILD_WITH_QT6) - QT6_WRAP_CPP(QGIS_QUICK_APP_MOC_SRCS ${QGIS_QUICK_APP_MOC_HDRS}) -else() - QT5_WRAP_CPP(QGIS_QUICK_APP_MOC_SRCS ${QGIS_QUICK_APP_MOC_HDRS}) -endif() +qt_wrap_cpp(QGIS_QUICK_APP_MOC_SRCS ${QGIS_QUICK_APP_MOC_HDRS}) set(QGIS_QUICK_APP_RCCS qml.qrc) set(QGIS_QUICK_APP_NAME qgis_quickapp) diff --git a/tests/src/server/wfs/CMakeLists.txt b/tests/src/server/wfs/CMakeLists.txt index 0aacad90382a..956f39ce05ae 100644 --- a/tests/src/server/wfs/CMakeLists.txt +++ b/tests/src/server/wfs/CMakeLists.txt @@ -27,11 +27,7 @@ set(MODULE_WFS_SRCS set(MODULE_WFS_HDRS ) -if (BUILD_WITH_QT6) - QT6_WRAP_CPP(MODULE_WFS_MOC_SRCS ${MODULE_WFS_HDRS}) -else() - QT5_WRAP_CPP(MODULE_WFS_MOC_SRCS ${MODULE_WFS_HDRS}) -endif() +qt_wrap_cpp(MODULE_WFS_MOC_SRCS ${MODULE_WFS_HDRS}) ############################################################# # Tests: diff --git a/tests/src/server/wms/CMakeLists.txt b/tests/src/server/wms/CMakeLists.txt index f1aace81a0db..a6f84a722ea6 100644 --- a/tests/src/server/wms/CMakeLists.txt +++ b/tests/src/server/wms/CMakeLists.txt @@ -33,11 +33,7 @@ set(MODULE_WMS_HDRS ${CMAKE_SOURCE_DIR}/src/server/services/wms/qgswmsserviceexception.h ) -if (BUILD_WITH_QT6) - QT6_WRAP_CPP(MODULE_WMS_MOC_SRCS ${MODULE_WMS_HDRS}) -else() - QT5_WRAP_CPP(MODULE_WMS_MOC_SRCS ${MODULE_WMS_HDRS}) -endif() +qt_wrap_cpp(MODULE_WMS_MOC_SRCS ${MODULE_WMS_HDRS}) ############################################################# # Tests: @@ -52,5 +48,5 @@ set(TESTS ) foreach(TESTSRC ${TESTS}) - ADD_QGIS_TEST(${TESTSRC} MODULE server LINKEDLIBRARIES qgis_server wms_static) + ADD_QGIS_TEST(${TESTSRC} MODULE server LINKEDLIBRARIES qgis_server wms_static) endforeach(TESTSRC) From 484389a8f450114709aa55732efab8c49b100e4f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 10:19:32 +0100 Subject: [PATCH 03/10] Use versionless target --- src/3d/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/3d/CMakeLists.txt b/src/3d/CMakeLists.txt index ee4e94d71eb4..f19a94d01cc9 100644 --- a/src/3d/CMakeLists.txt +++ b/src/3d/CMakeLists.txt @@ -288,11 +288,7 @@ target_include_directories(qgis_3d PUBLIC ${CMAKE_SOURCE_DIR}/external/tinygltf ) -if (BUILD_WITH_QT6) - target_link_libraries(qgis_3d Qt6::3DCore Qt6::3DRender Qt6::3DInput Qt6::3DLogic Qt6::3DExtras) -else() - target_link_libraries(qgis_3d Qt5::3DCore Qt5::3DRender Qt5::3DInput Qt5::3DLogic Qt5::3DExtras) -endif() +target_link_libraries(qgis_3d Qt::3DCore Qt::3DRender Qt::3DInput Qt::3DLogic Qt::3DExtras) GENERATE_EXPORT_HEADER( qgis_3d From 26c656b6aed746f990bed7601ff7479ad2d9b185 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 10:39:08 +0100 Subject: [PATCH 04/10] QtPositioning is required, no need to make it optional --- src/core/CMakeLists.txt | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a97f8f43aa74..282648be6661 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -83,6 +83,7 @@ set(QGIS_CORE_SRCS gps/qgsgpsinformation.cpp gps/qgsgpslogger.cpp gps/qgsnmeaconnection.cpp + gps/qgsqtlocationconnection.cpp gps/qgssatelliteinformation.cpp gps/qgsvectorlayergpslogger.cpp @@ -1066,12 +1067,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set_source_files_properties(qgsspatialindex.cpp PROPERTIES COMPILE_FLAGS -Wno-overloaded-virtual) endif() -if (${QT_VERSION_BASE}Positioning_FOUND) - set(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} - gps/qgsqtlocationconnection.cpp - ) -endif() - if(NOT MSVC) set_source_files_properties( ${FLEX_QgsExpressionLexer_OUTPUTS} @@ -1549,6 +1544,8 @@ set(QGIS_CORE_HDRS gps/qgsgpsinformation.h gps/qgsgpslogger.h gps/qgsnmeaconnection.h + gps/qgsqtlocationconnection.h + gps/qgsgpsconnectionregistry.h gps/qgssatelliteinformation.h gps/qgsvectorlayergpslogger.h @@ -2170,13 +2167,6 @@ if (NOT WITH_QTWEBKIT) ) endif() -if (${QT_VERSION_BASE}Positioning_FOUND) - set(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} - gps/qgsqtlocationconnection.h - ) -endif() - - if (HAVE_WEBENGINE) set(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} web/qgswebenginepage.cpp @@ -2215,13 +2205,6 @@ endif() # install qgsconfig.h and plugin.h here so they can get into # the OS X framework target -if (${QT_VERSION_BASE}Positioning_FOUND) - set(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} - gps/qgsqtlocationconnection.h - gps/qgsgpsconnectionregistry.h - ) -endif() - if (HAVE_OPENCL) set(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} qgsopenclutils.cpp @@ -2565,6 +2548,7 @@ target_link_libraries(qgis_core ${QT_VERSION_BASE}::Network ${QT_VERSION_BASE}::Sql ${QT_VERSION_BASE}::Concurrent + ${QT_VERSION_BASE}::Positioning ${OPTIONAL_QTWEBKIT} ${QCA_LIBRARY} GEOS::geos_c @@ -2680,12 +2664,6 @@ if (${QT_VERSION_BASE}SerialPort_FOUND) ) endif() -if (${QT_VERSION_BASE}Positioning_FOUND) - target_link_libraries(qgis_core - ${QT_VERSION_BASE}::Positioning - ) -endif() - target_compile_definitions(qgis_core PRIVATE "-DQT_NO_FOREACH") target_compile_definitions(qgis_core PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"") From defa363d07d19f0a117b6925e0d410605ab20b4f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 10:46:24 +0100 Subject: [PATCH 05/10] Use more versionless Qt and remove obsolete condition QtQml is REQUIRED --- src/core/CMakeLists.txt | 42 +++++++++++++++------------------------- src/gui/CMakeLists.txt | 43 ++++++++++------------------------------- 2 files changed, 26 insertions(+), 59 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 282648be6661..91af2b071b29 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2364,18 +2364,9 @@ if (MSVC) endif() target_include_directories(qgis_core SYSTEM PUBLIC - ${${QT_VERSION_BASE}Core_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Gui_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Xml_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Widgets_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Svg_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Network_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Sql_INCLUDE_DIRS} - ${${QT_VERSION_BASE}Concurrent_INCLUDE_DIRS} ${LIBZIP_INCLUDE_DIRS} ${SPATIALINDEX_INCLUDE_DIR} # before GEOS for case-insensitive filesystems ${QCA_INCLUDE_DIR} - ${${QT_VERSION_BASE}SerialPort_INCLUDE_DIRS} ${Protobuf_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${EXIV2_INCLUDE_DIR} @@ -2476,7 +2467,7 @@ GENERATE_EXPORT_HEADER( set(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} ${CMAKE_CURRENT_BINARY_DIR}/qgis_core.h) if(ENABLE_MODELTEST) - target_link_libraries(qgis_core ${QT_VERSION_BASE}::Test) + target_link_libraries(qgis_core Qt::Test) endif() if (NOT WITH_INTERNAL_POLY2TRI) @@ -2540,15 +2531,15 @@ if (APPLE) endif() target_link_libraries(qgis_core - ${QT_VERSION_BASE}::Core - ${QT_VERSION_BASE}::Gui - ${QT_VERSION_BASE}::Xml - ${QT_VERSION_BASE}::Widgets - ${QT_VERSION_BASE}::Svg - ${QT_VERSION_BASE}::Network - ${QT_VERSION_BASE}::Sql - ${QT_VERSION_BASE}::Concurrent - ${QT_VERSION_BASE}::Positioning + Qt::Core + Qt::Gui + Qt::Xml + Qt::Widgets + Qt::Svg + Qt::Network + Qt::Sql + Qt::Concurrent + Qt::Positioning ${OPTIONAL_QTWEBKIT} ${QCA_LIBRARY} GEOS::geos_c @@ -2575,8 +2566,7 @@ else() endif() if (WITH_QTPRINTER) - target_link_libraries(qgis_core ${QT_VERSION_BASE}::PrintSupport) - target_include_directories(qgis_core SYSTEM PUBLIC ${${QT_VERSION_BASE}PrintSupport_INCLUDE_DIRS}) + target_link_libraries(qgis_core Qt::PrintSupport) endif() if (WITH_DRACO) @@ -2612,13 +2602,13 @@ endif() if (WITH_QTWEBENGINE) if(BUILD_WITH_QT6) target_link_libraries(qgis_core - ${QT_VERSION_BASE}::WebEngineCore + Qt::WebEngineCore ) else() # QWebEnginePage is in WebEngineWidgets for Qt5 target_link_libraries(qgis_core - ${QT_VERSION_BASE}::WebEngineCore - ${QT_VERSION_BASE}::WebEngineWidgets + Qt::WebEngineCore + Qt::WebEngineWidgets ) endif() endif() @@ -2658,9 +2648,9 @@ if (FORCE_STATIC_LIBS) endif() endif() -if (${QT_VERSION_BASE}SerialPort_FOUND) +if (WITH_QTSERIALPORT) target_link_libraries(qgis_core - ${QT_VERSION_BASE}::SerialPort + Qt::SerialPort ) endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index e3a1cc9e40eb..6e3b283a034d 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -210,6 +210,7 @@ set(QGIS_GUI_SRCS editorwidgets/qgslistwidgetwrapper.cpp editorwidgets/qgslistconfigdlg.cpp editorwidgets/qgsmultiedittoolbutton.cpp + editorwidgets/qgsqmlwidgetwrapper.cpp editorwidgets/qgsrangeconfigdlg.cpp editorwidgets/qgsrangewidgetwrapper.cpp editorwidgets/qgsrangewidgetfactory.cpp @@ -1188,6 +1189,7 @@ set(QGIS_GUI_HDRS editorwidgets/qgslistwidgetfactory.h editorwidgets/qgslistwidgetwrapper.h editorwidgets/qgsmultiedittoolbutton.h + editorwidgets/qgsqmlwidgetwrapper.h editorwidgets/qgsrangeconfigdlg.h editorwidgets/qgsrangewidgetfactory.h editorwidgets/qgsrangewidgetwrapper.h @@ -1619,23 +1621,8 @@ set(QGIS_GUI_PRIVATE_HDRS find_package(${QT_VERSION_BASE} COMPONENTS Multimedia MultimediaWidgets Qml QuickWidgets UiTools REQUIRED) -if(${QT_VERSION_BASE}Qml_FOUND) - add_definitions(-DWITH_QML) - set(QGIS_GUI_HDRS - ${QGIS_GUI_HDRS} - editorwidgets/qgsqmlwidgetwrapper.h - ) -endif() - # for installing headers -if(${QT_VERSION_BASE}Qml_FOUND) - set(QGIS_GUI_SRCS - ${QGIS_GUI_SRCS} - editorwidgets/qgsqmlwidgetwrapper.cpp - ) -endif() - set_property(GLOBAL PROPERTY QGIS_GUI_HDRS ${QGIS_GUI_HDRS}) if(ENABLE_MODELTEST) @@ -1703,16 +1690,6 @@ target_include_directories(qgis_gui SYSTEM PUBLIC ${QSCINTILLA_INCLUDE_DIR} ) -target_include_directories(qgis_gui SYSTEM PRIVATE - ${QT_QTUITOOLS_INCLUDE_DIR} -) - -if (BUILD_WITH_QT6) - target_include_directories(qgis_gui SYSTEM PRIVATE - ${${QT_VERSION_BASE}Svg_INCLUDE_DIRS} - ) -endif() - target_include_directories(qgis_gui PUBLIC ${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui/actions @@ -1829,13 +1806,13 @@ add_dependencies(qgis_gui ui) target_link_libraries(qgis_gui qgis_core qgis_native - ${QT_VERSION_BASE}::UiTools + Qt::UiTools ${QWT_LIBRARY} ${QSCINTILLA_LIBRARY} - ${QT_VERSION_BASE}::Qml - ${QT_VERSION_BASE}::QuickWidgets - ${QT_VERSION_BASE}::Multimedia - ${QT_VERSION_BASE}::MultimediaWidgets + Qt::Qml + Qt::QuickWidgets + Qt::Multimedia + Qt::MultimediaWidgets ) if (BUILD_WITH_QT6) @@ -1848,13 +1825,13 @@ endif() if (WITH_QTWEBENGINE) find_package(${QT_VERSION_BASE} COMPONENTS WebEngineWidgets REQUIRED) target_link_libraries(qgis_gui - ${QT_VERSION_BASE}::WebEngineWidgets + Qt::WebEngineWidgets ) endif() if (WITH_QTGAMEPAD) target_link_libraries(qgis_gui - ${QT_VERSION_BASE}::Gamepad + Qt::Gamepad ) endif() @@ -1880,7 +1857,7 @@ if (FORCE_STATIC_LIBS) endif() if(ENABLE_MODELTEST) - target_link_libraries(qgis_gui ${QT_VERSION_BASE}::Test) + target_link_libraries(qgis_gui Qt::Test) endif() # We use private headers from core that need this From e76a5870fc6bb9654d5119b96a5aefc7c00db171 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 10:50:38 +0100 Subject: [PATCH 06/10] Fix sip_include --- python/PyQt6/core/core_auto.sip | 4 ++-- python/PyQt6/gui/gui_auto.sip | 2 +- python/core/core_auto.sip | 4 ++-- python/gui/gui_auto.sip | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/PyQt6/core/core_auto.sip b/python/PyQt6/core/core_auto.sip index 52d5f3e440b3..2e4c73048b77 100644 --- a/python/PyQt6/core/core_auto.sip +++ b/python/PyQt6/core/core_auto.sip @@ -381,6 +381,8 @@ %Include auto_generated/gps/qgsgpsinformation.sip %Include auto_generated/gps/qgsgpslogger.sip %Include auto_generated/gps/qgsnmeaconnection.sip +%Include auto_generated/gps/qgsqtlocationconnection.sip +%Include auto_generated/gps/qgsgpsconnectionregistry.sip %Include auto_generated/gps/qgssatelliteinformation.sip %Include auto_generated/gps/qgsvectorlayergpslogger.sip %Include auto_generated/labeling/qgscalloutposition.sip @@ -805,8 +807,6 @@ %Include auto_generated/vectortile/qgsvectortileutils.sip %Include auto_generated/vectortile/qgsvectortilewriter.sip %Include auto_generated/vectortile/qgsvtpktiles.sip -%Include auto_generated/gps/qgsqtlocationconnection.sip %If ( HAVE_WEBENGINE_SIP ) %Include auto_generated/web/qgswebenginepage.sip %End -%Include auto_generated/gps/qgsgpsconnectionregistry.sip diff --git a/python/PyQt6/gui/gui_auto.sip b/python/PyQt6/gui/gui_auto.sip index 136b33a3e15b..35732536c183 100644 --- a/python/PyQt6/gui/gui_auto.sip +++ b/python/PyQt6/gui/gui_auto.sip @@ -327,6 +327,7 @@ %Include auto_generated/editorwidgets/qgsjsoneditwidget.sip %End %Include auto_generated/editorwidgets/qgsmultiedittoolbutton.sip +%Include auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip %Include auto_generated/editorwidgets/qgsrelationaggregatesearchwidgetwrapper.sip %Include auto_generated/editorwidgets/qgsrelationreferencesearchwidgetwrapper.sip %Include auto_generated/editorwidgets/qgsrelationreferencewidget.sip @@ -534,4 +535,3 @@ %Include auto_generated/tiledscene/qgstiledscenerendererpropertieswidget.sip %Include auto_generated/tiledscene/qgstiledscenerendererwidget.sip %Include auto_generated/vectortile/qgsvectortilelayerproperties.sip -%Include auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip diff --git a/python/core/core_auto.sip b/python/core/core_auto.sip index 52d5f3e440b3..2e4c73048b77 100644 --- a/python/core/core_auto.sip +++ b/python/core/core_auto.sip @@ -381,6 +381,8 @@ %Include auto_generated/gps/qgsgpsinformation.sip %Include auto_generated/gps/qgsgpslogger.sip %Include auto_generated/gps/qgsnmeaconnection.sip +%Include auto_generated/gps/qgsqtlocationconnection.sip +%Include auto_generated/gps/qgsgpsconnectionregistry.sip %Include auto_generated/gps/qgssatelliteinformation.sip %Include auto_generated/gps/qgsvectorlayergpslogger.sip %Include auto_generated/labeling/qgscalloutposition.sip @@ -805,8 +807,6 @@ %Include auto_generated/vectortile/qgsvectortileutils.sip %Include auto_generated/vectortile/qgsvectortilewriter.sip %Include auto_generated/vectortile/qgsvtpktiles.sip -%Include auto_generated/gps/qgsqtlocationconnection.sip %If ( HAVE_WEBENGINE_SIP ) %Include auto_generated/web/qgswebenginepage.sip %End -%Include auto_generated/gps/qgsgpsconnectionregistry.sip diff --git a/python/gui/gui_auto.sip b/python/gui/gui_auto.sip index 136b33a3e15b..35732536c183 100644 --- a/python/gui/gui_auto.sip +++ b/python/gui/gui_auto.sip @@ -327,6 +327,7 @@ %Include auto_generated/editorwidgets/qgsjsoneditwidget.sip %End %Include auto_generated/editorwidgets/qgsmultiedittoolbutton.sip +%Include auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip %Include auto_generated/editorwidgets/qgsrelationaggregatesearchwidgetwrapper.sip %Include auto_generated/editorwidgets/qgsrelationreferencesearchwidgetwrapper.sip %Include auto_generated/editorwidgets/qgsrelationreferencewidget.sip @@ -534,4 +535,3 @@ %Include auto_generated/tiledscene/qgstiledscenerendererpropertieswidget.sip %Include auto_generated/tiledscene/qgstiledscenerendererwidget.sip %Include auto_generated/vectortile/qgsvectortilelayerproperties.sip -%Include auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip From 7ed4d4cf954a27bcc6428f247e4475b61452f9fe Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 11:50:34 +0100 Subject: [PATCH 07/10] Avoid versionless Qt:: target dependencies see https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html#pitfalls-when-using-versionless-targets exported targets will suffer --- src/3d/CMakeLists.txt | 8 +++++++- src/core/CMakeLists.txt | 30 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/3d/CMakeLists.txt b/src/3d/CMakeLists.txt index f19a94d01cc9..f8a0583f4a38 100644 --- a/src/3d/CMakeLists.txt +++ b/src/3d/CMakeLists.txt @@ -288,7 +288,13 @@ target_include_directories(qgis_3d PUBLIC ${CMAKE_SOURCE_DIR}/external/tinygltf ) -target_link_libraries(qgis_3d Qt::3DCore Qt::3DRender Qt::3DInput Qt::3DLogic Qt::3DExtras) +target_link_libraries(qgis_3d + ${QT_VERSION_BASE}::3DCore + ${QT_VERSION_BASE}::3DRender + ${QT_VERSION_BASE}::3DInput + ${QT_VERSION_BASE}::3DLogic + ${QT_VERSION_BASE}::3DExtras +) GENERATE_EXPORT_HEADER( qgis_3d diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 91af2b071b29..ba1a6cc0c920 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2467,7 +2467,7 @@ GENERATE_EXPORT_HEADER( set(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} ${CMAKE_CURRENT_BINARY_DIR}/qgis_core.h) if(ENABLE_MODELTEST) - target_link_libraries(qgis_core Qt::Test) + target_link_libraries(qgis_core ${QT_VERSION_BASE}::Test) endif() if (NOT WITH_INTERNAL_POLY2TRI) @@ -2531,15 +2531,15 @@ if (APPLE) endif() target_link_libraries(qgis_core - Qt::Core - Qt::Gui - Qt::Xml - Qt::Widgets - Qt::Svg - Qt::Network - Qt::Sql - Qt::Concurrent - Qt::Positioning + ${QT_VERSION_BASE}::Core + ${QT_VERSION_BASE}::Gui + ${QT_VERSION_BASE}::Xml + ${QT_VERSION_BASE}::Widgets + ${QT_VERSION_BASE}::Svg + ${QT_VERSION_BASE}::Network + ${QT_VERSION_BASE}::Sql + ${QT_VERSION_BASE}::Concurrent + ${QT_VERSION_BASE}::Positioning ${OPTIONAL_QTWEBKIT} ${QCA_LIBRARY} GEOS::geos_c @@ -2566,7 +2566,7 @@ else() endif() if (WITH_QTPRINTER) - target_link_libraries(qgis_core Qt::PrintSupport) + target_link_libraries(qgis_core ${QT_VERSION_BASE}::PrintSupport) endif() if (WITH_DRACO) @@ -2602,13 +2602,13 @@ endif() if (WITH_QTWEBENGINE) if(BUILD_WITH_QT6) target_link_libraries(qgis_core - Qt::WebEngineCore + ${QT_VERSION_BASE}::WebEngineCore ) else() # QWebEnginePage is in WebEngineWidgets for Qt5 target_link_libraries(qgis_core - Qt::WebEngineCore - Qt::WebEngineWidgets + ${QT_VERSION_BASE}::WebEngineCore + ${QT_VERSION_BASE}::WebEngineWidgets ) endif() endif() @@ -2650,7 +2650,7 @@ endif() if (WITH_QTSERIALPORT) target_link_libraries(qgis_core - Qt::SerialPort + ${QT_VERSION_BASE}::SerialPort ) endif() From d2078b0092bef0b1895a6223dc428f8a01d7d7fb Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 16:23:03 +0100 Subject: [PATCH 08/10] [cmake] Use PostgreSQL::PostgreSQL target --- src/app/CMakeLists.txt | 17 +++-------------- src/plugins/grass/CMakeLists.txt | 4 ---- src/providers/mssql/CMakeLists.txt | 1 - src/providers/postgres/CMakeLists.txt | 25 +++---------------------- src/server/CMakeLists.txt | 1 - src/server/services/wcs/CMakeLists.txt | 4 ---- src/server/services/wfs/CMakeLists.txt | 4 ---- src/server/services/wfs3/CMakeLists.txt | 4 ---- src/server/services/wms/CMakeLists.txt | 4 ---- src/server/services/wmts/CMakeLists.txt | 4 ---- 10 files changed, 6 insertions(+), 62 deletions(-) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index fa5b9892cd56..7d9c02299d80 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -435,12 +435,6 @@ else() set(QWTPOLAR_INCLUDE_DIR "") endif() -if (POSTGRES_FOUND) - if(HAVE_PGCONFIG) - add_definitions(-DHAVE_PGCONFIG=1) - endif() -endif() - # Test data dir for QgsAppScreenShots add_definitions(-DTEST_DATA_DIR="${TEST_DATA_DIR}") @@ -513,10 +507,6 @@ if (APPLE) include_directories(${CMAKE_SOURCE_DIR}/src/native/mac) endif() -if (POSTGRES_FOUND) - include_directories(SYSTEM ${POSTGRES_INCLUDE_DIR}) -endif() - ############# if (ANDROID) add_library(${QGIS_APP_NAME} ${LIBRARY_TYPE} ${QGIS_APPMAIN_SRCS}) @@ -549,6 +539,9 @@ add_library(qgis_app ${LIBRARY_TYPE} ${QGIS_APP_SRCS}) target_compile_features(qgis_app PRIVATE cxx_std_17) target_compile_definitions(qgis_app PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"") +if (POSTGRES_FOUND) + target_compile_definitions(qgis_app PRIVATE -DPOSTGRESQL_VERSION=${PostgreSQL_VERSION_STRING}) +endif() target_include_directories(qgis_app PUBLIC ${CMAKE_SOURCE_DIR}/external/nmea @@ -693,10 +686,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") target_link_libraries(${QGIS_APP_NAME} ${EXECINFO_LIBRARY}) endif() -if (POSTGRES_FOUND) - target_link_libraries (qgis_app ${POSTGRES_LIBRARY}) -endif() - if (WITH_PDAL) target_link_libraries(qgis_app ${PDAL_LIBRARIES}) endif() diff --git a/src/plugins/grass/CMakeLists.txt b/src/plugins/grass/CMakeLists.txt index 21ef3d47c86c..cf928078f133 100644 --- a/src/plugins/grass/CMakeLists.txt +++ b/src/plugins/grass/CMakeLists.txt @@ -80,10 +80,6 @@ include_directories( ${CMAKE_BINARY_DIR}/src/app ${CMAKE_CURRENT_BINARY_DIR} ) -include_directories(SYSTEM - ${POSTGRES_INCLUDE_DIR} -) - macro(ADD_GRASSPLUGIN GRASS_BUILD_VERSION) set(GRASS_PREFIX ${GRASS_PREFIX${GRASS_BUILD_VERSION}}) diff --git a/src/providers/mssql/CMakeLists.txt b/src/providers/mssql/CMakeLists.txt index 995e28e41980..6bac286e9e82 100644 --- a/src/providers/mssql/CMakeLists.txt +++ b/src/providers/mssql/CMakeLists.txt @@ -68,7 +68,6 @@ target_compile_definitions(provider_mssql_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_ target_link_libraries (provider_mssql_a qgis_core - ${POSTGRES_LIBRARY} ${Qt5Xml_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Svg_LIBRARIES} diff --git a/src/providers/postgres/CMakeLists.txt b/src/providers/postgres/CMakeLists.txt index 42e82b190b2f..a61fb7c2dd68 100644 --- a/src/providers/postgres/CMakeLists.txt +++ b/src/providers/postgres/CMakeLists.txt @@ -44,10 +44,6 @@ add_library (provider_postgres_a STATIC ${PG_SRCS} ${PG_HDRS}) set_target_properties(provider_postgres_a PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS}) -target_include_directories(provider_postgres_a SYSTEM PUBLIC - ${POSTGRES_INCLUDE_DIR} -) - target_include_directories(provider_postgres_a PUBLIC ${CMAKE_SOURCE_DIR}/src/providers/postgres ) @@ -58,7 +54,7 @@ target_compile_definitions(provider_postgres_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMA target_link_libraries (provider_postgres_a qgis_core - ${POSTGRES_LIBRARY} + PostgreSQL::PostgreSQL ) if (WITH_GUI) @@ -68,10 +64,6 @@ if (WITH_GUI) set_target_properties(provider_postgres_gui_a PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS}) - target_include_directories(provider_postgres_gui_a SYSTEM PRIVATE - ${POSTGRES_INCLUDE_DIR} - ) - target_include_directories(provider_postgres_gui_a PUBLIC ${CMAKE_BINARY_DIR}/src/providers/postgres ) @@ -83,7 +75,6 @@ if (WITH_GUI) target_link_libraries(provider_postgres_gui_a qgis_gui provider_postgres_a - ${POSTGRES_LIBRARY} ) add_dependencies(provider_postgres_gui_a ui) endif() @@ -103,9 +94,6 @@ set(PGRASTER_SRCS # static library add_library (provider_postgresraster_a STATIC ${PGRASTER_SRCS} ${PG_HDRS}) -target_include_directories(provider_postgresraster_a SYSTEM PRIVATE - ${POSTGRES_INCLUDE_DIR} -) target_include_directories(provider_postgresraster_a PUBLIC ${CMAKE_SOURCE_DIR}/src/providers/postgres/raster ) @@ -117,7 +105,6 @@ target_compile_definitions(provider_postgresraster_a PRIVATE "CMAKE_SOURCE_DIR=\ target_link_libraries (provider_postgresraster_a qgis_core provider_postgres_a - ${POSTGRES_LIBRARY} ) if (WITH_GUI) @@ -144,12 +131,6 @@ else() set_target_properties(provider_postgres PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS}) set_target_properties(provider_postgresraster PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS}) - target_include_directories(provider_postgres SYSTEM PRIVATE - ${POSTGRES_INCLUDE_DIR} - ) - target_include_directories(provider_postgresraster SYSTEM PRIVATE - ${POSTGRES_INCLUDE_DIR} - ) target_include_directories(provider_postgresraster PRIVATE ${CMAKE_SOURCE_DIR}/src/providers/postgres ) @@ -162,12 +143,12 @@ else() target_link_libraries(provider_postgres qgis_core - ${POSTGRES_LIBRARY} + PostgreSQL::PostgreSQL ) target_link_libraries(provider_postgresraster qgis_core - ${POSTGRES_LIBRARY} + PostgreSQL::PostgreSQL ) if (WITH_GUI) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index de9ecf8fde6e..f1c1fb6368eb 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -120,7 +120,6 @@ endif() target_link_libraries(qgis_server qgis_core ${FCGI_LIBRARY} - ${POSTGRES_LIBRARY} ${QCA_LIBRARY} ) diff --git a/src/server/services/wcs/CMakeLists.txt b/src/server/services/wcs/CMakeLists.txt index e728e6fc11ac..04cd461997be 100644 --- a/src/server/services/wcs/CMakeLists.txt +++ b/src/server/services/wcs/CMakeLists.txt @@ -18,10 +18,6 @@ add_library (wcs MODULE ${wcs_SRCS}) # require c++17 target_compile_features(wcs PRIVATE cxx_std_17) -include_directories(SYSTEM - ${POSTGRES_INCLUDE_DIR} -) - include_directories( ${CMAKE_SOURCE_DIR}/src/server ${CMAKE_SOURCE_DIR}/src/server/services diff --git a/src/server/services/wfs/CMakeLists.txt b/src/server/services/wfs/CMakeLists.txt index 8a3cb2417136..dc080b5e6ba1 100644 --- a/src/server/services/wfs/CMakeLists.txt +++ b/src/server/services/wfs/CMakeLists.txt @@ -34,10 +34,6 @@ foreach(_library_type MODULE STATIC) # require c++17 target_compile_features(${_library_name} PRIVATE cxx_std_17) - include_directories(${_library_name} SYSTEM PUBLIC - ${POSTGRES_INCLUDE_DIR} - ) - target_include_directories(${_library_name} PUBLIC ${CMAKE_SOURCE_DIR}/src/server ${CMAKE_SOURCE_DIR}/src/server/services diff --git a/src/server/services/wfs3/CMakeLists.txt b/src/server/services/wfs3/CMakeLists.txt index b0b8a2440989..789d9e8724bf 100644 --- a/src/server/services/wfs3/CMakeLists.txt +++ b/src/server/services/wfs3/CMakeLists.txt @@ -15,10 +15,6 @@ add_library (wfs3 MODULE ${WFS3_SRCS}) # require c++17 target_compile_features(wfs3 PRIVATE cxx_std_17) -include_directories(SYSTEM - ${POSTGRES_INCLUDE_DIR} -) - include_directories( ${CMAKE_SOURCE_DIR}/src/server diff --git a/src/server/services/wms/CMakeLists.txt b/src/server/services/wms/CMakeLists.txt index 651e44162bd7..63a7ff7b47d6 100644 --- a/src/server/services/wms/CMakeLists.txt +++ b/src/server/services/wms/CMakeLists.txt @@ -45,10 +45,6 @@ foreach(_library_type MODULE STATIC) # require c++17 target_compile_features(${_library_name} PRIVATE cxx_std_17) - include_directories(${_library_name} SYSTEM PUBLIC - ${POSTGRES_INCLUDE_DIR} - ) - target_include_directories(${_library_name} PUBLIC ${CMAKE_SOURCE_DIR}/src/server ${CMAKE_SOURCE_DIR}/src/server/services diff --git a/src/server/services/wmts/CMakeLists.txt b/src/server/services/wmts/CMakeLists.txt index 23b7fb8b86b5..9f90ced2904f 100644 --- a/src/server/services/wmts/CMakeLists.txt +++ b/src/server/services/wmts/CMakeLists.txt @@ -23,10 +23,6 @@ add_library (wmts MODULE ${WMTS_SRCS} ${WMTS_HDRS}) # require c++17 target_compile_features(wmts PRIVATE cxx_std_17) -include_directories(SYSTEM - ${POSTGRES_INCLUDE_DIR} -) - include_directories( ${CMAKE_SOURCE_DIR}/src/server/ From 658ecdcea98d1b125c00aadc99c8b5a8f62989e7 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 16:35:20 +0100 Subject: [PATCH 09/10] Remove legacy include (for ubuntu precise) --- .ci/ogc/build.sh | 1 - .docker/docker-qgis-build.sh | 1 - .docker/qgis.dockerfile | 1 - CMakeLists.txt | 7 ------- 4 files changed, 10 deletions(-) diff --git a/.ci/ogc/build.sh b/.ci/ogc/build.sh index 7bbfb6d43d24..0edf4f36157c 100755 --- a/.ci/ogc/build.sh +++ b/.ci/ogc/build.sh @@ -22,7 +22,6 @@ cmake -GNinja \ -DWITH_3D=OFF \ -DWITH_STAGED_PLUGINS=OFF \ -DWITH_GRASS=OFF \ - -DSUPPRESS_QT_WARNINGS=ON \ -DENABLE_MODELTEST=OFF \ -DENABLE_PGTEST=OFF \ -DENABLE_MSSQLTEST=OFF \ diff --git a/.docker/docker-qgis-build.sh b/.docker/docker-qgis-build.sh index ec4d47c50448..8ae149e715b2 100755 --- a/.docker/docker-qgis-build.sh +++ b/.docker/docker-qgis-build.sh @@ -90,7 +90,6 @@ cmake \ -DWITH_GRASS7=${WITH_GRASS7} \ -DWITH_GRASS8=${WITH_GRASS8} \ -DWITH_GRASS_PLUGIN=${WITH_GRASS8} \ - -DSUPPRESS_QT_WARNINGS=ON \ -DENABLE_TESTS=ON \ -DENABLE_MODELTEST=${WITH_QT5} \ -DENABLE_PGTEST=${WITH_QT5} \ diff --git a/.docker/qgis.dockerfile b/.docker/qgis.dockerfile index dbfb6c205747..31d5789ee148 100644 --- a/.docker/qgis.dockerfile +++ b/.docker/qgis.dockerfile @@ -42,7 +42,6 @@ RUN SUCCESS=OK \ -DBINDINGS_GLOBAL_INSTALL=ON \ -DWITH_STAGED_PLUGINS=ON \ -DWITH_GRASS=ON \ - -DSUPPRESS_QT_WARNINGS=ON \ -DDISABLE_DEPRECATED=ON \ -DENABLE_TESTS=OFF \ -DWITH_QSPATIALITE=ON \ diff --git a/CMakeLists.txt b/CMakeLists.txt index a58881918c05..1c0e1a69dabb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -675,13 +675,6 @@ if(WITH_CORE) find_package(Libtasn1 REQUIRED) endif() - if (SUPPRESS_QT_WARNINGS) - # Newer versions of UseQt4.cmake include Qt with -isystem automatically - # This can be used to force this behavior on older systems - # Can be removed as soon as Travis-CI updates from precise - include_directories(SYSTEM ${QT_INCLUDE_DIR}) - endif() - # Disable automatic conversion from QString to ASCII 8-bit strings (char *) # (Keeps code compatible with Qt/Mac/64bit) add_definitions(-DQT_NO_CAST_TO_ASCII) From 2ea9e796037fd8f16718642c5acd6f7d7d3a88b6 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 30 Dec 2024 16:36:33 +0100 Subject: [PATCH 10/10] Remove leftover include --- src/app/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 7d9c02299d80..9f642ca0dfb1 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -579,7 +579,6 @@ if (WITH_3D) endif() target_include_directories(qgis_app SYSTEM PUBLIC - ${QT_QTUITOOLS_INCLUDE_DIR} ${QWTPOLAR_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/external/qt-unix-signals )