Skip to content
Permalink
Browse files

Merge pull request #42474 from m-kuhn/qt6cmake

[qt6] CMake build adjustments for qt6
  • Loading branch information
m-kuhn committed Mar 25, 2021
2 parents e713cd7 + 7a56c36 commit 877b2ff66ac5f35ef63f1248624fb7b81df41218
Showing with 22 additions and 17 deletions.
  1. +14 −13 CMakeLists.txt
  2. +2 −2 cmake/FindQCA.cmake
  3. +2 −2 cmake/FindQtKeychain.cmake
  4. +4 −0 src/core/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)
@@ -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)
@@ -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}"
@@ -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}

0 comments on commit 877b2ff

Please sign in to comment.