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

Adapt build system for building against qt6

parent 4bc99c90
Pipeline #121148 passed with stage
in 5 minutes and 14 seconds
......@@ -65,7 +65,7 @@ set(QT_REQUIRED_VERSION "5.15.2")
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets)
set(LIBGRAVATAR_VERSION "5.19.40")
set(MAILCOMMON_LIB_VERSION "5.19.42")
set(MESSAGELIB_LIB_VERSION "5.19.40")
......@@ -140,8 +140,8 @@ find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED)
find_package(MailTransportDBusService CONFIG REQUIRED)
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)
......
......@@ -11,7 +11,7 @@ macro( archivemail_agent _source)
add_executable( ${_name} ${_test} )
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(archivemailagent-${_name})
target_link_libraries( ${_name} archivemailagent Qt::Test Qt::Core KF5::MailCommon KF5::AkonadiCore KF5::XmlGui KF5::KIOWidgets KF5::I18n)
target_link_libraries( ${_name} archivemailagent Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Core KF5::MailCommon KF5::AkonadiCore KF5::XmlGui KF5::KIOWidgets KF5::I18n)
endmacro()
archivemail_agent(archivemailinfotest.cpp )
......
......@@ -75,7 +75,7 @@ target_link_libraries(akonadi_followupreminder_agent
KF5::Mime
KF5::CalendarCore
KF5::DBusAddons
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::Notifications
KF5::I18n
KF5::XmlGui
......
......@@ -12,7 +12,7 @@ macro( followupreminder_agent _source )
ecm_add_test(${_test}
TEST_NAME ${_name}
NAME_PREFIX "followupreminder-"
LINK_LIBRARIES followupreminderagent Qt::Test KF5::AkonadiCore Qt::Widgets KF5::I18n KF5::XmlGui KF5::Service
LINK_LIBRARIES followupreminderagent Qt${QT_MAJOR_VERSION}::Test KF5::AkonadiCore Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n KF5::XmlGui KF5::Service
)
endmacro()
......
......@@ -7,6 +7,6 @@ macro( mailmerge_agent _source )
ecm_add_test(${_test}
TEST_NAME ${_name}
NAME_PREFIX "mailmerge-"
LINK_LIBRARIES mailmergeagent Qt::Test KF5::AkonadiCore Qt::Widgets KF5::I18n KF5::XmlGui KF5::Service
LINK_LIBRARIES mailmergeagent Qt${QT_MAJOR_VERSION}::Test KF5::AkonadiCore Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n KF5::XmlGui KF5::Service
)
endmacro()
......@@ -6,7 +6,7 @@ macro(add_sendlater_agent_test _source )
ecm_add_test(${_source}
TEST_NAME ${_name}
NAME_PREFIX "sendlateragent-"
LINK_LIBRARIES sendlateragent Qt::Test
LINK_LIBRARIES sendlateragent Qt${QT_MAJOR_VERSION}::Test
)
endmacro()
......
......@@ -37,7 +37,7 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
endif()
target_link_libraries(ktnef
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::Tnef
KF5::DBusAddons
KF5::Crash
......
......@@ -435,9 +435,14 @@ target_link_libraries(kmailprivate
KF5::WebEngineViewer
KF5::SyntaxHighlighting
KF5::GuiAddons
qt5keychain
${kmail_userfeedback_LIB}
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(kmailprivate PRIVATE qt6keychain)
else()
target_link_libraries(kmailprivate PRIVATE qt5keychain)
endif()
target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageList,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageViewer,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MailCommon,INTERFACE_INCLUDE_DIRECTORIES>)
......
......@@ -12,35 +12,35 @@ include_directories(
add_executable( displaymessageformatactionmenutest displaymessageformatactionmenutest.cpp displaymessageformatactionmenutest.h)
add_test(NAME displaymessageformatactionmenutest COMMAND displaymessageformatactionmenutest )
ecm_mark_as_test(kmail-displaymessageformatactionmenutest)
target_link_libraries( displaymessageformatactionmenutest Qt::Test KF5::MessageViewer KF5::I18n kmailprivate)
target_link_libraries( displaymessageformatactionmenutest Qt${QT_MAJOR_VERSION}::Test KF5::MessageViewer KF5::I18n kmailprivate)
#####
add_executable( identityaddvcarddialogtest identityaddvcarddialogtest.cpp identityaddvcarddialogtest.h)
ecm_mark_as_test(kmail-identityaddvcarddialogtest)
target_link_libraries( identityaddvcarddialogtest Qt::Test Qt::Widgets KF5::Completion KF5::KIOWidgets KF5::I18n kmailprivate)
target_link_libraries( identityaddvcarddialogtest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::Completion KF5::KIOWidgets KF5::I18n kmailprivate)
#####
add_executable( createfollowupreminderonexistingmessagejobtest createfollowupreminderonexistingmessagejobtest.cpp createfollowupreminderonexistingmessagejobtest.h)
ecm_mark_as_test(kmail_createfollowupreminderonexistingmessagejobtest)
target_link_libraries( createfollowupreminderonexistingmessagejobtest Qt::Test Qt::Widgets KF5::AkonadiCore KF5::CalendarCore KF5::Mime KF5::MessageComposer kmailprivate)
target_link_libraries( createfollowupreminderonexistingmessagejobtest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::AkonadiCore KF5::CalendarCore KF5::Mime KF5::MessageComposer kmailprivate)
#####
add_executable( cryptostateindicatorwidgettest cryptostateindicatorwidgettest.cpp cryptostateindicatorwidgettest.h)
add_test(NAME cryptostateindicatorwidgettest COMMAND cryptostateindicatorwidgettest)
ecm_mark_as_test(cryptostateindicatorwidgettest)
target_link_libraries( cryptostateindicatorwidgettest Qt::Test KF5::MessageCore Qt::Widgets KF5::ConfigWidgets KF5::I18n kmailprivate)
target_link_libraries( cryptostateindicatorwidgettest Qt${QT_MAJOR_VERSION}::Test KF5::MessageCore Qt${QT_MAJOR_VERSION}::Widgets KF5::ConfigWidgets KF5::I18n kmailprivate)
#####
add_executable( kactionmenutransporttest kactionmenutransporttest.cpp kactionmenutransporttest.h)
add_test(NAME kactionmenutransporttest COMMAND kactionmenutransporttest)
ecm_mark_as_test(kactionmenutransporttest)
target_link_libraries( kactionmenutransporttest Qt::Test KF5::MailTransportAkonadi KF5::WidgetsAddons KF5::I18n KF5::ConfigGui kmailprivate)
target_link_libraries( kactionmenutransporttest Qt${QT_MAJOR_VERSION}::Test KF5::MailTransportAkonadi KF5::WidgetsAddons KF5::I18n KF5::ConfigGui kmailprivate)
add_akonadi_isolated_test_advanced( kmcomposerwintest.cpp ""
"Qt::Test;KF5::IdentityManagement;KF5::MessageCore;KF5::TemplateParser;KF5::XmlGui;Qt::Widgets;KF5::ConfigWidgets;KF5::I18n;kmailprivate")
"Qt${QT_MAJOR_VERSION}::Test;KF5::IdentityManagement;KF5::MessageCore;KF5::TemplateParser;KF5::XmlGui;Qt${QT_MAJOR_VERSION}::Widgets;KF5::ConfigWidgets;KF5::I18n;kmailprivate")
add_akonadi_isolated_test_advanced( tagselectdialogtest.cpp "" "kmailprivate;KF5::MailCommon;KF5::Libkdepim;KF5::ItemViews;KF5::TemplateParser;KF5::XmlGui;KF5::Completion;KF5::I18n")
add_akonadi_isolated_test_advanced(kmcommandstest.cpp ""
"Qt::Test;Qt::Widgets;KF5::AkonadiCore;KF5::Bookmarks;KF5::ConfigWidgets;KF5::Contacts;KF5::I18n;KF5::IdentityManagement;KF5::KIOCore;KF5::KIOFileWidgets;KF5::MessageCore;KF5::MessageComposer;KF5::MessageList;KF5::MessageViewer;KF5::MailCommon;KF5::MailTransportAkonadi;KF5::Libkdepim;KF5::TemplateParser;kmailprivate")
"Qt${QT_MAJOR_VERSION}::Test;Qt${QT_MAJOR_VERSION}::Widgets;KF5::AkonadiCore;KF5::Bookmarks;KF5::ConfigWidgets;KF5::Contacts;KF5::I18n;KF5::IdentityManagement;KF5::KIOCore;KF5::KIOFileWidgets;KF5::MessageCore;KF5::MessageComposer;KF5::MessageList;KF5::MessageViewer;KF5::MailCommon;KF5::MailTransportAkonadi;KF5::Libkdepim;KF5::TemplateParser;kmailprivate")
......@@ -8,7 +8,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 kmailprivate)
target_link_libraries( ${_name} Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Core KF5::AkonadiCore KF5::ConfigCore kmailprivate)
endmacro()
folderarchive_kmail(folderarchiveaccountinfotest.cpp)
......@@ -4,7 +4,7 @@ macro(add_kmail_historyswitchfolder_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source} ${_name}.h
TEST_NAME ${_name}
LINK_LIBRARIES kmailprivate Qt::Test Qt::Widgets
LINK_LIBRARIES kmailprivate Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets
)
endmacro ()
......
......@@ -4,7 +4,7 @@ macro(add_kmail_job_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source} ${_name}.h
TEST_NAME ${_name}
LINK_LIBRARIES kmailprivate Qt::Test Qt::Widgets KF5::AkonadiCore
LINK_LIBRARIES kmailprivate Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::AkonadiCore
)
endmacro ()
......
......@@ -29,7 +29,7 @@ pim_target_precompile_headers(kcmkmailsummary PUBLIC ../../../kmail_pch.h)
add_dependencies(kcmkmailsummary kmail_xml)
target_link_libraries(kcmkmailsummary KF5::Mime KF5::PimCommonAkonadi Qt::DBus KF5::ConfigWidgets KF5::I18n)
target_link_libraries(kcmkmailsummary KF5::Mime KF5::PimCommonAkonadi Qt${QT_MAJOR_VERSION}::DBus KF5::ConfigWidgets KF5::I18n)
########### install files ###############
......
......@@ -18,7 +18,7 @@ target_link_libraries(kontact_summaryplugin KF5::KCMUtils KF5::I18n KF5::Identit
add_library(kcmkontactsummary MODULE kcmkontactsummary.cpp kcmkontactsummary.h)
pim_target_precompile_headers(kcmkontactsummary PUBLIC ../../../kmail_pch.h)
target_link_libraries(kcmkontactsummary KF5::I18n Qt::Widgets KF5::I18n KF5::KontactInterface)
target_link_libraries(kcmkontactsummary KF5::I18n Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n KF5::KontactInterface)
########### install files ###############
......
......@@ -8,5 +8,10 @@ target_link_libraries(sievedebugdialog
KF5::AkonadiCore
KF5::SyntaxHighlighting
kmailprivate
qt5keychain
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(sievedebugdialog qt6keychain)
else()
target_link_libraries(sievedebugdialog qt5keychain)
endif()
......@@ -7,5 +7,10 @@ target_link_libraries(sievemanagerdialog
KF5::KSieveUi
KF5::AkonadiCore
kmailprivate
qt5keychain
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(sievemanagerdialog qt6keychain)
else()
target_link_libraries(sievemanagerdialog qt5keychain)
endif()
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: BSD-3-Clause
add_executable(vacationmultiservertest main.cpp)
target_link_libraries(vacationmultiservertest KF5::KSieveUi KF5::KSieve KF5::I18n KF5::AkonadiCore qt5keychain kmailprivate)
target_link_libraries(vacationmultiservertest KF5::KSieveUi KF5::KSieve KF5::I18n KF5::AkonadiCore kmailprivate)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(vacationmultiservertest qt6keychain)
else()
target_link_libraries(vacationmultiservertest qt5keychain)
endif()
......@@ -7,11 +7,11 @@ set(dbustest_SRCS dbustest.cpp)
qt_add_dbus_interfaces(dbustest_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml)
add_executable(dbustest ${dbustest_SRCS})
add_dependencies(dbustest kmail_xml)
target_link_libraries(dbustest KF5::KIOCore KF5::I18n Qt::DBus)
target_link_libraries(dbustest KF5::KIOCore KF5::I18n Qt${QT_MAJOR_VERSION}::DBus)
#####
add_executable(searchdbustest searchdbustest.cpp searchdbustest.h)
target_link_libraries(searchdbustest Qt::DBus Qt::Widgets KF5::PimCommonAkonadi)
target_link_libraries(searchdbustest Qt${QT_MAJOR_VERSION}::DBus Qt${QT_MAJOR_VERSION}::Widgets KF5::PimCommonAkonadi)
#####
add_executable(searchmailertest searchmailertest.cpp)
......
......@@ -4,7 +4,7 @@ macro(add_kmail_undosend_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source} ${_name}.h
TEST_NAME ${_name}
LINK_LIBRARIES kmailprivate Qt::Test Qt::Widgets
LINK_LIBRARIES kmailprivate Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets
)
endmacro ()
......
Markdown is supported
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