Skip to content
Permalink
Browse files
A bunch of gui cmake fixes for qt6
  • Loading branch information
nyalldawson committed Jul 20, 2021
1 parent c313b27 commit 8be17527e00f06a1a3c6b02e8ca2b720fd6e2d0b
@@ -16,7 +16,11 @@ if (WITH_GUI)
gui/qgsauthbasicedit.h
)
set(AUTH_BASIC_UIS gui/qgsauthbasicedit.ui)
QT5_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS})
if (WITH_QT6)
QT6_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS})
else()
QT5_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS})
endif()
endif()


@@ -16,7 +16,11 @@ if (WITH_GUI)
gui/qgsauthesritokenedit.h
)
set(AUTH_ESRITOKEN_UIS gui/qgsauthesritokenedit.ui)
QT5_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS})
if (WITH_QT6)
QT6_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS})
else()
QT5_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS})
endif()
endif()


@@ -16,7 +16,11 @@ if (WITH_GUI)
gui/qgsauthidentcertedit.h
)
set(AUTH_IDENTCERT_UIS gui/qgsauthidentcertedit.ui)
QT5_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS})
if (WITH_QT6)
QT6_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS})
else()
QT5_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS})
endif()
endif()


@@ -16,7 +16,11 @@ if (WITH_GUI)
gui/qgsauthpkipathsedit.h
)
set(AUTH_PKIPATHS_UIS gui/qgsauthpkipathsedit.ui)
QT5_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS})
if (WITH_QT6)
QT6_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS})
else()
QT5_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS})
endif()
endif()

# static library
@@ -16,7 +16,11 @@ if (WITH_GUI)
gui/qgsauthpkcs12edit.h
)
set(AUTH_PKCS12_UIS gui/qgsauthpkcs12edit.ui)
QT5_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS})
if (WITH_QT6)
QT6_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS})
else()
QT5_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS})
endif()
endif()

# static library
@@ -1266,24 +1266,28 @@ set(QGIS_GUI_PRIVATE_HDRS
attributetable/qgsfeaturefilterwidget_p.h
)

find_package(Qt5 COMPONENTS Qml QuickWidgets REQUIRED)
if (WITH_QT6)
# No QML for now
else()
find_package(Qt5 COMPONENTS Qml QuickWidgets REQUIRED)

if(Qt5Qml_FOUND)
add_definitions(-DWITH_QML)
set(QGIS_GUI_HDRS
${QGIS_GUI_HDRS}
editorwidgets/qgsqmlwidgetwrapper.h
)
endif()
if(Qt5Qml_FOUND)
add_definitions(-DWITH_QML)
set(QGIS_GUI_HDRS
${QGIS_GUI_HDRS}
editorwidgets/qgsqmlwidgetwrapper.h
)
endif()

# for installing headers
# for installing headers

if(Qt5Qml_FOUND)
if(Qt5Qml_FOUND)

set(QGIS_GUI_SRCS
${QGIS_GUI_SRCS}
editorwidgets/qgsqmlwidgetwrapper.cpp
)
set(QGIS_GUI_SRCS
${QGIS_GUI_SRCS}
editorwidgets/qgsqmlwidgetwrapper.cpp
)
endif()
endif()

set_property(GLOBAL PROPERTY QGIS_GUI_HDRS ${QGIS_GUI_HDRS})
@@ -1497,10 +1501,10 @@ add_dependencies(qgis_gui ui)
target_link_libraries(qgis_gui
qgis_core
qgis_native
${Qt5UiTools_LIBRARIES}
${${QT_VERSION_BASE}UiTools_LIBRARIES}
${QWT_LIBRARY}
${QSCINTILLA_LIBRARY}
${Qt5QuickWidgets_LIBRARIES}
${${QT_VERSION_BASE}QuickWidgets_LIBRARIES}
)

if (FORCE_STATIC_LIBS)
@@ -1516,7 +1520,7 @@ if (FORCE_STATIC_LIBS)
endif()

if(ENABLE_MODELTEST)
target_link_libraries(qgis_gui ${Qt5Test_LIBRARIES})
target_link_libraries(qgis_gui ${${QT_VERSION_BASE}Test_LIBRARIES})
endif()

target_compile_definitions(qgis_gui PRIVATE "-DQT_NO_FOREACH")
@@ -73,7 +73,11 @@ target_link_libraries (provider_postgres_a
)

if (WITH_GUI)
QT5_WRAP_UI(PG_UIS_H ${PG_UIS})
if (WITH_QT6)
QT6_WRAP_UI(PG_UIS_H ${PG_UIS})
else()
QT5_WRAP_UI(PG_UIS_H ${PG_UIS})
endif()

add_library(provider_postgres_gui_a STATIC ${PG_GUI_SRCS} ${PG_UIS_H})

@@ -108,14 +112,14 @@ target_compile_features(provider_postgresraster_a PRIVATE cxx_std_17)
target_link_libraries (provider_postgresraster_a
qgis_core
${POSTGRES_LIBRARY}
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Sql_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${${QT_VERSION_BASE}Xml_LIBRARIES}
${${QT_VERSION_BASE}Core_LIBRARIES}
${${QT_VERSION_BASE}Svg_LIBRARIES}
${${QT_VERSION_BASE}Network_LIBRARIES}
${${QT_VERSION_BASE}Sql_LIBRARIES}
${${QT_VERSION_BASE}Concurrent_LIBRARIES}
${${QT_VERSION_BASE}Gui_LIBRARIES}
${${QT_VERSION_BASE}Widgets_LIBRARIES}
)

if (WITH_GUI)
@@ -30,7 +30,11 @@ if (WITH_GUI)
endif()

if (WITH_GUI)
QT5_WRAP_UI(vlayer_provider_UI_H qgsvirtuallayersourceselectbase.ui qgsembeddedlayerselect.ui)
if (WITH_QT6)
QT6_WRAP_UI(vlayer_provider_UI_H qgsvirtuallayersourceselectbase.ui qgsembeddedlayerselect.ui)
else()
QT5_WRAP_UI(vlayer_provider_UI_H qgsvirtuallayersourceselectbase.ui qgsembeddedlayerselect.ui)
endif()
endif()

include_directories(
@@ -56,9 +60,9 @@ target_compile_features(provider_virtuallayer PRIVATE cxx_std_17)

target_link_libraries(provider_virtuallayer
qgis_core
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${${QT_VERSION_BASE}Core_LIBRARIES}
${${QT_VERSION_BASE}Gui_LIBRARIES}
${${QT_VERSION_BASE}Widgets_LIBRARIES}
${SQLITE3_LIBRARY}
${SPATIALITE_LIBRARY}
)
@@ -37,7 +37,11 @@ if (WITH_GUI)
${CMAKE_CURRENT_BINARY_DIR}
)

QT5_WRAP_UI(WMS_UIS_H ${WMS_UIS})
if (WITH_QT6)
QT6_WRAP_UI(WMS_UIS_H ${WMS_UIS})
else()
QT5_WRAP_UI(WMS_UIS_H ${WMS_UIS})
endif()

add_library(provider_wms_gui_a STATIC ${WMS_GUI_SRCS} ${WMS_UIS_H})

@@ -50,27 +54,27 @@ endif()

target_link_libraries(provider_wms_a
qgis_core
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Sql_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
${${QT_VERSION_BASE}Xml_LIBRARIES}
${${QT_VERSION_BASE}Core_LIBRARIES}
${${QT_VERSION_BASE}Svg_LIBRARIES}
${${QT_VERSION_BASE}Network_LIBRARIES}
${${QT_VERSION_BASE}Sql_LIBRARIES}
${${QT_VERSION_BASE}Concurrent_LIBRARIES}
)
target_compile_definitions(provider_wms_a PRIVATE "-DQT_NO_FOREACH")

if (WITH_GUI)
target_link_libraries(provider_wms_gui_a
qgis_gui
provider_wms_a
${Qt5Xml_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Sql_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${${QT_VERSION_BASE}Xml_LIBRARIES}
${${QT_VERSION_BASE}Core_LIBRARIES}
${${QT_VERSION_BASE}Svg_LIBRARIES}
${${QT_VERSION_BASE}Network_LIBRARIES}
${${QT_VERSION_BASE}Sql_LIBRARIES}
${${QT_VERSION_BASE}Concurrent_LIBRARIES}
${${QT_VERSION_BASE}Gui_LIBRARIES}
${${QT_VERSION_BASE}Widgets_LIBRARIES}
)
target_compile_definitions(provider_wms_gui_a PRIVATE "-DQT_NO_FOREACH")
endif()
@@ -17,24 +17,46 @@ file(GLOB NUMERICFORMAT_UIS "${CMAKE_CURRENT_SOURCE_DIR}/numericformats/*.ui")
file(GLOB ATTRIBUTEFORMCONFIG_UIS "${CMAKE_CURRENT_SOURCE_DIR}/attributeformconfig/*.ui")
file(GLOB GEOREFERENCER_UIS "${CMAKE_CURRENT_SOURCE_DIR}/georeferencer/*.ui")

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}
)
if (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}
)
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}
)
endif()

add_custom_target(ui ALL DEPENDS ${QGIS_UIS_H})

0 comments on commit 8be1752

Please sign in to comment.