diff --git a/CMakeLists.txt b/CMakeLists.txt index d49e55b2e3a..c090f2a54b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,12 +451,17 @@ if(WITH_CORE) endif() find_package(${QT_VERSION_BASE} COMPONENTS Core Gui Widgets Network Xml Svg Concurrent Test UiTools Sql REQUIRED) + if (WITH_QT6) + find_package(${QT_VERSION_BASE} COMPONENTS Core5Compat REQUIRED) + else() + # TODO only available starting from Qt 6.2 + find_package(${QT_VERSION_BASE} COMPONENTS Positioning) + endif() if (NOT IOS) find_package(${QT_VERSION_BASE} COMPONENTS PrintSupport REQUIRED) else() add_definitions(-DQT_NO_PRINTER) endif() - find_package(${QT_VERSION_BASE} COMPONENTS Positioning) if (WITH_QTWEBKIT AND NOT WITH_QT6) find_package(Qt5WebKit REQUIRED) find_package(Qt5WebKitWidgets REQUIRED) @@ -506,18 +511,14 @@ if(WITH_CORE) endif() # Password helper - if (WITH_QT6) - # nope, not yet! - else() - find_package(QtKeychain REQUIRED) - # Master password hash and authentication encryption - find_package(QCA REQUIRED) - # Check for runtime dependency of qca-ossl plugin - # REQUIRED if unit tests are to be run from build directory - if(NOT MSVC) - include(QCAMacros) - FIND_QCAOSSL_PLUGIN_CPP(ENABLE_TESTS) - endif() + find_package(QtKeychain REQUIRED) + # Master password hash and authentication encryption + find_package(QCA REQUIRED) + # Check for runtime dependency of qca-ossl plugin + # REQUIRED if unit tests are to be run from build directory + if(NOT MSVC) + include(QCAMacros) + FIND_QCAOSSL_PLUGIN_CPP(ENABLE_TESTS) endif() if (APPLE) diff --git a/cmake/FindQCA.cmake b/cmake/FindQCA.cmake index 1258e415932..5b0d460c13a 100644 --- a/cmake/FindQCA.cmake +++ b/cmake/FindQCA.cmake @@ -20,7 +20,7 @@ if(QCA_INCLUDE_DIR AND QCA_LIBRARY) else(QCA_INCLUDE_DIR AND QCA_LIBRARY) - set(QCA_LIBRARY_NAMES qca-qt5 qca2-qt5) + set(QCA_LIBRARY_NAMES qca-qt5 qca2-qt5 qca-qt6) find_library(QCA_LIBRARY NAMES ${QCA_LIBRARY_NAMES} @@ -45,7 +45,7 @@ else(QCA_INCLUDE_DIR AND QCA_LIBRARY) "$ENV{LIB_DIR}/include" $ENV{INCLUDE} /usr/local/include - PATH_SUFFIXES QtCrypto qt5/QtCrypto Qca-qt5/QtCrypto qt/Qca-qt5/QtCrypto qt5/Qca-qt5/QtCrypto + PATH_SUFFIXES QtCrypto qt5/QtCrypto Qca-qt5/QtCrypto qt/Qca-qt5/QtCrypto qt5/Qca-qt5/QtCrypto Qca-qt6/QtCrypto ) if(QCA_LIBRARY AND QCA_INCLUDE_DIR) diff --git a/cmake/FindQtKeychain.cmake b/cmake/FindQtKeychain.cmake index 7c9279ca90c..4f4b723a4cc 100644 --- a/cmake/FindQtKeychain.cmake +++ b/cmake/FindQtKeychain.cmake @@ -21,10 +21,10 @@ FIND_PATH(QTKEYCHAIN_INCLUDE_DIR keychain.h $ENV{INCLUDE} /usr/local/include /usr/include - PATH_SUFFIXES qt5keychain qtkeychain + PATH_SUFFIXES qt5keychain qtkeychain qt6keychain ) -FIND_LIBRARY(QTKEYCHAIN_LIBRARY NAMES qt5keychain qtkeychain +FIND_LIBRARY(QTKEYCHAIN_LIBRARY NAMES qt5keychain qtkeychain qt6keychain PATHS ${LIB_DIR} "$ENV{LIB_DIR}" diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6a27b2f4873..b84eb14545c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1925,6 +1925,10 @@ target_link_libraries(qgis_core ${ZLIB_LIBRARIES} ) +if (WITH_QT6) + target_link_libraries(qgis_core Qt6::Core5Compat) +endif() + if (WITH_EPT) target_link_libraries(qgis_core ${ZSTD_LIBRARY}