Skip to content

Commit

Permalink
Use more versionless Qt and remove obsolete condition
Browse files Browse the repository at this point in the history
QtQml is REQUIRED
  • Loading branch information
m-kuhn committed Dec 30, 2024
1 parent 26c656b commit defa363
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 59 deletions.
42 changes: 16 additions & 26 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down
43 changes: 10 additions & 33 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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()

Expand All @@ -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
Expand Down

0 comments on commit defa363

Please sign in to comment.