[qt6] CMake build adjustments for qt6

This commit is contained in:
Denis Rouzaud 2021-03-23 22:07:15 +01:00 committed by Matthias Kuhn
parent 8e8febb405
commit 7a56c36d55
4 changed files with 22 additions and 17 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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}"

View File

@ -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}