Commit fc50054e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent a8b850ae
Pipeline #121306 passed with stage
in 7 minutes and 41 seconds
......@@ -105,8 +105,8 @@ set_package_properties(Qt5TextToSpeech PROPERTIES DESCRIPTION
if(Qt5TextToSpeech_FOUND)
set(HAVE_TEXT_TO_SPEECH_SUPPORT TRUE)
endif()
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Network Widgets Test XmlPatterns DBus NetworkAuth)
find_package(Qt5WebEngineWidgets ${QT_REQUIRED_VERSION} CONFIG)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Network Widgets Test XmlPatterns DBus NetworkAuth)
find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets ${QT_REQUIRED_VERSION} CONFIG)
# KF5 package
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
......@@ -149,8 +149,8 @@ find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
#it will replace kwallet support
find_package(Qt5Keychain CONFIG)
set_package_properties(Qt5Keychain PROPERTIES
find_package(Qt${QT_MAJOR_VERSION}Keychain CONFIG)
set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
DESCRIPTION "Provides support for secure credentials storage"
URL "https://github.com/frankosterfeld/qtkeychain"
TYPE REQUIRED)
......@@ -162,6 +162,12 @@ add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
if (QT_MAJOR_VERSION STREQUAL "6")
set(kdepim-keychain_lib qt6keychain)
else()
set(kdepim-keychain_lib qt5keychain)
endif()
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
if (USE_UNITY_CMAKE_SUPPORT)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
......
......@@ -7,6 +7,6 @@ add_executable(schedulertest schedulertest.cpp ../migrationscheduler.cpp ../migr
target_link_libraries(schedulertest
gidmigration
KF5::AkonadiCore
Qt::Test
Qt${QT_MAJOR_VERSION}::Test
)
add_test(NAME schedulertest COMMAND schedulertest)
......@@ -50,7 +50,7 @@ target_link_libraries( akonadi_newmailnotifier_agent
if(Qt5TextToSpeech_FOUND)
target_link_libraries( akonadi_newmailnotifier_agent
Qt::TextToSpeech
Qt${QT_MAJOR_VERSION}::TextToSpeech
)
endif()
......@@ -83,7 +83,7 @@ target_sources(newmailnotifierconfig PRIVATE
target_link_libraries(newmailnotifierconfig
KF5::AkonadiCore
KF5::AkonadiMime
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::NotifyConfig
KF5::ConfigGui
KF5::I18n
......
......@@ -6,7 +6,7 @@ set(newmailnotifieragent_common_SRCS)
set(newmailnotifierselectcollectionwidget_SRCS newmailnotifierselectcollectionwidget_test.cpp ../newmailnotifierselectcollectionwidget.cpp ${newmailnotifieragent_common_SRCS})
add_executable(newmailnotifierselectcollectionwidgettest ${newmailnotifierselectcollectionwidget_SRCS})
target_link_libraries(newmailnotifierselectcollectionwidgettest
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::I18n
KF5::AkonadiCore
KF5::Mime
......
......@@ -13,9 +13,9 @@ target_link_libraries(kio_akonadi
KF5::KIOCore
KF5::AkonadiCore
KF5::I18n
Qt::DBus
Qt::Widgets
Qt::Network
Qt${QT_MAJOR_VERSION}::DBus
Qt${QT_MAJOR_VERSION}::Widgets
Qt${QT_MAJOR_VERSION}::Network
)
set_target_properties(kio_akonadi PROPERTIES OUTPUT_NAME "akonadi")
......
......@@ -31,7 +31,7 @@ target_link_libraries(migrationshared
KF5::AkonadiCore
KF5::ConfigCore
KF5::I18n
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
)
......
......@@ -25,6 +25,6 @@ target_link_libraries(googlegroupwaremigration
KF5::ConfigGui
KF5::I18n
KF5::Wallet
Qt::DBus
Qt${QT_MAJOR_VERSION}::DBus
migrationshared
)
......@@ -91,7 +91,7 @@ target_link_libraries(akonadi_davgroupware_resource
KF5::WindowSystem
KF5::DAV
KF5::Service
Qt::Xml
Qt${QT_MAJOR_VERSION}::Xml
)
install(TARGETS akonadi_davgroupware_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -51,7 +51,7 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
endif()
target_link_libraries(akonadi_etesync_resource
${ETEBASE_LIBRARIES}
Qt::DBus
Qt${QT_MAJOR_VERSION}::DBus
KF5::AkonadiAgentBase
KF5::ConfigCore
KF5::Contacts
......
......@@ -139,7 +139,7 @@ ecm_qt_declare_logging_category(EWSCLIENT_SRCS
add_library(ewsclient STATIC ${EWSCLIENT_SRCS})
target_link_libraries(ewsclient
Qt::Network
Qt${QT_MAJOR_VERSION}::Network
KF5::KIOCore
KF5::KIOFileWidgets
KF5::KIOWidgets
......@@ -150,8 +150,8 @@ target_link_libraries(ewsclient
if (Qt5NetworkAuth_FOUND)
target_link_libraries(ewsclient
Qt::NetworkAuth
Qt::WebEngineWidgets)
Qt${QT_MAJOR_VERSION}::NetworkAuth
Qt${QT_MAJOR_VERSION}::WebEngineWidgets)
endif ()
if (Qca-qt5_FOUND)
......
......@@ -23,9 +23,9 @@ qt_add_dbus_interface(isolatestestcommon_SRCS ${ewsresourceinterface_xml} ewsres
add_library(isolatedtestcommon STATIC ${isolatestestcommon_SRCS})
target_link_libraries(isolatedtestcommon
KF5::AkonadiCore
Qt::Core
Qt::Network
Qt::Test
Qt${QT_MAJOR_VERSION}::Core
Qt${QT_MAJOR_VERSION}::Network
Qt${QT_MAJOR_VERSION}::Test
fakeewsserver
)
......
......@@ -13,6 +13,6 @@ set(fakeewsserver_SRCS
add_library(fakeewsserver ${fakeewsserver_SRCS})
generate_export_header(fakeewsserver BASE_NAME fakeewsserver)
target_link_libraries(fakeewsserver Qt::Core Qt::Network Qt::XmlPatterns)
target_link_libraries(fakeewsserver Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Network Qt${QT_MAJOR_VERSION}::XmlPatterns)
add_subdirectory(test)
......@@ -7,7 +7,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
macro(akonadi_fakeserver_add_test tname)
add_executable(${tname} ${tname}.cpp)
target_link_libraries(${tname} Qt::Test fakeewsserver)
target_link_libraries(${tname} Qt${QT_MAJOR_VERSION}::Test fakeewsserver)
add_test(NAME ${tname} COMMAND ${tname})
endmacro(akonadi_fakeserver_add_test tname)
......
......@@ -6,11 +6,11 @@
kde_enable_exceptions()
add_library(uttesthelpers STATIC faketransferjob.cpp)
target_link_libraries(uttesthelpers Qt::Core KF5::KIOCore)
target_link_libraries(uttesthelpers Qt${QT_MAJOR_VERSION}::Core KF5::KIOCore)
macro(akonadi_ews_add_ut_advanced utname extra_SRCS)
add_executable(${utname} ${utname}.cpp ${extra_SRCS})
target_link_libraries(${utname} Qt::Test uttesthelpers)
target_link_libraries(${utname} Qt${QT_MAJOR_VERSION}::Test uttesthelpers)
add_test(NAME ${utname} COMMAND ${utname})
endmacro(akonadi_ews_add_ut_advanced utname)
......@@ -45,9 +45,9 @@ if (Qt5NetworkAuth_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/../../ewsclient/auth/ewsoauth.cpp)
akonadi_ews_add_ut_advanced(ewsoauth_ut "${ewsoauth_ut_SRCS}")
target_link_libraries(ewsoauth_ut
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::I18n
Qt::WebEngineWidgets
Qt${QT_MAJOR_VERSION}::WebEngineWidgets
)
target_compile_definitions(ewsoauth_ut PUBLIC -DEWSOAUTH_UNITTEST)
endif ()
......@@ -23,7 +23,7 @@ target_link_libraries(facebookresourcelib
KF5::I18n
KF5::ConfigGui
KF5::CalendarCore
Qt::WebEngineWidgets
Qt${QT_MAJOR_VERSION}::WebEngineWidgets
KF5::Wallet
KF5::Codecs
)
......@@ -38,7 +38,7 @@ target_link_libraries(akonadi_facebook_resource
KF5::I18n
KF5::Wallet
KF5::Codecs
Qt::WebEngineWidgets
Qt${QT_MAJOR_VERSION}::WebEngineWidgets
KF5::KIOCore
)
......
......@@ -23,7 +23,7 @@ PRIVATE
KF5::AkonadiWidgets
KF5::ConfigCore
KF5::I18n
Qt::DBus
Qt${QT_MAJOR_VERSION}::DBus
)
set_target_properties(folderarchivesettings PROPERTIES VERSION ${KDEPIMRUNTIME_LIB_VERSION} SOVERSION ${KDEPIMRUNTIME_LIB_SOVERSION} )
......
......@@ -7,7 +7,7 @@ macro( folderarchive_kmail _source )
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(folderararchive-${_name})
target_link_libraries( ${_name} Qt::Test Qt::Core KF5::AkonadiCore KF5::ConfigCore)
target_link_libraries( ${_name} Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Core KF5::AkonadiCore KF5::ConfigCore)
endmacro()
folderarchive_kmail(folderarchiveaccountinfotest.cpp)
......@@ -108,8 +108,8 @@ qt_add_dbus_adaptor( imapresource_LIB_SRCS
add_library(imapresource STATIC ${imapresource_LIB_SRCS})
target_link_libraries(imapresource
Qt::DBus
Qt::Network
Qt${QT_MAJOR_VERSION}::DBus
Qt${QT_MAJOR_VERSION}::Network
KF5::AkonadiCore
KF5::IMAP
KF5::MailTransport
......@@ -122,7 +122,7 @@ target_link_libraries(imapresource
KF5::WindowSystem
akonadi-singlefileresource
KF5::Libkdepim
qt5keychain
${kdepim-keychain_lib}
)
########### next target ###############
......@@ -162,7 +162,7 @@ if( APPLE )
endif ()
target_link_libraries(akonadi_imap_resource
Qt::DBus
Qt${QT_MAJOR_VERSION}::DBus
KF5::AkonadiCore
KF5::IMAP
akonadi-singlefileresource
......
......@@ -18,7 +18,7 @@ MACRO(IMAP_RESOURCE_UNIT_TESTS)
ecm_mark_as_test(imap-${_testname})
target_link_libraries(${_testname}
KF5::IMAP KF5::kimaptest Qt::Gui Qt::Core Qt::Test imapresource akonadi-singlefileresource)
KF5::IMAP KF5::kimaptest Qt${QT_MAJOR_VERSION}::Gui Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test imapresource akonadi-singlefileresource)
add_definitions(-DTEST_DATA="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"")
ENDFOREACH(_testname)
ENDMACRO(IMAP_RESOURCE_UNIT_TESTS)
......
......@@ -11,5 +11,5 @@ set(testsubscriptiondialog_SRCS
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/..)
add_executable(testsubscriptiondialog ${testsubscriptiondialog_SRCS})
target_link_libraries(testsubscriptiondialog KF5::KIOCore KF5::IMAP KF5::Mime KF5::ItemModels Qt::Widgets KF5::I18n KF5::KIOWidgets KF5::AkonadiCore KF5::MailTransport)
target_link_libraries(testsubscriptiondialog KF5::KIOCore KF5::IMAP KF5::Mime KF5::ItemModels Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n KF5::KIOWidgets KF5::AkonadiCore KF5::MailTransport)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment