Skip to content

Commit

Permalink
QtXmlPatterns does not exist in Qt6
Browse files Browse the repository at this point in the history
Make it clear that QtXmlPatterns is for Qt5 builds only.
  • Loading branch information
winterz committed Nov 13, 2023
1 parent 9568067 commit 35312fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,16 @@ set_package_properties(
PURPOSE "Needed for the Qt SCXML adapter (adapter itself depends on Qt RemoteObjects)"
)

find_package(Qt${Qt_VERSION_MAJOR}XmlPatterns ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(
Qt${Qt_VERSION_MAJOR}XmlPatterns PROPERTIES
TYPE OPTIONAL
DESCRIPTION "Qt XmlPatterns library"
PURPOSE "Required for unit tests dealing with XML input/output"
)
# QtXmlPatterns is removed since Qt6
if(NOT BUILD_QT6)
find_package(Qt5XmlPatterns ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(
Qt5XmlPatterns PROPERTIES
TYPE OPTIONAL
DESCRIPTION "Qt5 XmlPatterns library"
PURPOSE "Required with Qt5 for unit tests dealing with XML input/output"
)
endif()

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
Expand Down
4 changes: 2 additions & 2 deletions src/core/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-test.h)

# QtXmlPatterns fails badly on OSX -- see https://bugreports.qt-project.org/browse/QTBUG-40818
if(Qt${Qt_VERSION_MAJOR}XmlPatterns_FOUND AND NOT APPLE)
if(TARGET Qt5::XmlPatterns_FOUND AND NOT APPLE)
add_definitions(-DUSE_QT_XMLPATTERNS_LIB)
list(APPEND KDSME_TESTHELPER_EXTRA_LIBS Qt${Qt_VERSION_MAJOR}::XmlPatterns)
list(APPEND KDSME_TESTHELPER_EXTRA_LIBS Qt5::XmlPatterns)
endif()

add_library(kdsme_testhelper STATIC parsehelper.cpp util.cpp)
Expand Down

0 comments on commit 35312fb

Please sign in to comment.