diff --git a/Source/WebCore/PlatformQt.cmake b/Source/WebCore/PlatformQt.cmake index 640836faa843..14d003c70dc8 100644 --- a/Source/WebCore/PlatformQt.cmake +++ b/Source/WebCore/PlatformQt.cmake @@ -315,6 +315,13 @@ list(APPEND WebCore_LIBRARIES ${ZLIB_LIBRARIES} ) +if (Qt6Gui_VERSION VERSION_GREATER_EQUAL 6.10) + list(APPEND WebCore_PRIVATE_LIBRARIES Qt6::GuiPrivate) +endif () +if (Qt6Network_VERSION VERSION_GREATER_EQUAL 6.10) + list(APPEND WebCore_PRIVATE_LIBRARIES Qt6::NetworkPrivate) +endif () + if (QT_STATIC_BUILD) list(APPEND WebCore_LIBRARIES ${STATIC_LIB_DEPENDENCIES} diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake index d99e9c7bd625..2523a6f2c8ec 100644 --- a/Source/cmake/OptionsQt.cmake +++ b/Source/cmake/OptionsQt.cmake @@ -71,12 +71,13 @@ macro(CONVERT_PRL_LIBS_TO_CMAKE _qt_component) endmacro() macro(CHECK_Qt6_PRIVATE_INCLUDE_DIRS _qt_component _header) - # Qt6 provides private headers via Qt6::${_qt_component}Private target - find_package(Qt6${_qt_component}Private QUIET CONFIG) + set(CMAKE_REQUIRED_LIBRARIES Qt6::${_qt_component}) - if (NOT TARGET Qt6::${_qt_component}Private) - message(FATAL_ERROR "Qt6::${_qt_component}Private target not found. Please make sure Qt6 private headers are installed.") - endif() + # Qt 6.10+ provides private headers via Qt6::${_qt_component}Private target + if (Qt6${_qt_component}_VERSION VERSION_GREATER_EQUAL 6.10) + find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS ${_qt_component}Private) + list(APPEND CMAKE_REQUIRED_LIBRARIES Qt6::${_qt_component}Private) + endif () set(INCLUDE_TEST_SOURCE " @@ -85,9 +86,6 @@ macro(CHECK_Qt6_PRIVATE_INCLUDE_DIRS _qt_component _header) " ) - # Use the Private target directly - it provides the include dirs automatically - set(CMAKE_REQUIRED_LIBRARIES Qt6::${_qt_component} Qt6::${_qt_component}Private) - check_cxx_source_compiles("${INCLUDE_TEST_SOURCE}" Qt6${_qt_component}_PRIVATE_HEADER_FOUND) unset(INCLUDE_TEST_SOURCE) diff --git a/Tools/QtTestBrowser/CMakeLists.txt b/Tools/QtTestBrowser/CMakeLists.txt index 160f101d6d75..df2df312df84 100644 --- a/Tools/QtTestBrowser/CMakeLists.txt +++ b/Tools/QtTestBrowser/CMakeLists.txt @@ -44,7 +44,6 @@ set(QtTestBrowser_SYSTEM_INCLUDE_DIRECTORIES set(QtTestBrowser_LIBRARIES Qt6::Gui - Qt6::GuiPrivate Qt6::Network Qt6::Widgets WebKitWidgets @@ -55,6 +54,13 @@ if (TARGET Qt6::PrintSupport) list(APPEND QtTestBrowser_LIBRARIES Qt6::PrintSupport) endif () +if (Qt6Core_VERSION VERSION_GREATER_EQUAL 6.10) + list(APPEND QtTestBrowser_PRIVATE_LIBRARIES Qt6::CorePrivate) +endif () +if (Qt6Gui_VERSION VERSION_GREATER_EQUAL 6.10) + list(APPEND QtTestBrowser_PRIVATE_LIBRARIES Qt6::GuiPrivate) +endif () + qt_add_resources(QtTestBrowser_SOURCES QtTestBrowser.qrc )