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

GIT_SILENT: increase to qt5.15, cmake 3.16.0, use Qt:: vs Qt5:: for helping to port to qt6

parent 214b10bf
Pipeline #56845 skipped
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.17.40")
project(kmail VERSION ${PIM_VERSION})
......@@ -60,7 +60,7 @@ set(GRANTLEETHEME_LIB_VERSION "5.17.40")
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
set(KDEPIM_LIB_SOVERSION "5")
set(QT_REQUIRED_VERSION "5.14.0")
set(QT_REQUIRED_VERSION "5.15.0")
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)
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
......@@ -151,32 +151,26 @@ if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055100)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055200)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(KUserFeedback 1.0.0 CONFIG)
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
if (USE_UNITY_CMAKE_SUPPORT)
if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
else()
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
endif()
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
endif()
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF) # Set to OFF when using clazy and such
set(COMPILE_WITH_CMAKE_PCH_SUPPORT false)
macro(pim_target_precompile_headers)
if (USE_PRECOMPILED_HEADERS)
if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake pch build support")
else()
set(COMPILE_WITH_CMAKE_PCH_SUPPORT true)
endif()
if (COMPILE_WITH_CMAKE_PCH_SUPPORT)
target_precompile_headers(${ARGV})
......
......@@ -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 Qt5::Test Qt5::Core KF5::MailCommon KF5::AkonadiCore KF5::XmlGui KF5::KIOWidgets KF5::I18n)
target_link_libraries( ${_name} archivemailagent Qt::Test Qt5::Core KF5::MailCommon KF5::AkonadiCore KF5::XmlGui KF5::KIOWidgets KF5::I18n)
endmacro()
archivemail_agent(archivemailinfotest.cpp )
......
......@@ -66,7 +66,7 @@ target_link_libraries(akonadi_followupreminder_agent
KF5::Mime
KF5::CalendarCore
KF5::DBusAddons
Qt5::Widgets
Qt::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 Qt5::Test KF5::AkonadiCore Qt5::Widgets KF5::I18n KF5::XmlGui KF5::Service
LINK_LIBRARIES followupreminderagent Qt::Test KF5::AkonadiCore Qt5::Widgets KF5::I18n KF5::XmlGui KF5::Service
)
endmacro()
......
......@@ -4,7 +4,7 @@ macro(add_sendlater_agent_test _source )
ecm_add_test(${_source}
TEST_NAME ${_name}
NAME_PREFIX "sendlateragent-"
LINK_LIBRARIES sendlateragent Qt5::Test
LINK_LIBRARIES sendlateragent Qt::Test
)
endmacro()
......
......@@ -58,13 +58,8 @@ void SendLaterConfigTest::shouldAddAnItem()
info.setRecurrenceEachValue(5);
info.setRecurrenceUnit(MessageComposer::SendLaterInfo::Years);
const QDate date(2014, 1, 1);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
info.setDateTime(QDateTime(date));
info.setLastDateTimeSend(QDateTime(date));
#else
info.setDateTime(QDateTime(date.startOfDay()));
info.setLastDateTimeSend(QDateTime(date.startOfDay()));
#endif
SendLaterUtil::writeSendLaterInfo(mConfig, &info);
const QStringList itemList = mConfig->groupList().filter(mSendlaterRegExpFilter);
......
......@@ -33,13 +33,8 @@ void SendLaterUtilTest::shouldRestoreFromSettings()
info.setRecurrenceEachValue(5);
info.setRecurrenceUnit(MessageComposer::SendLaterInfo::Years);
const QDate date(2014, 1, 1);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
info.setDateTime(QDateTime(date));
info.setLastDateTimeSend(QDateTime(date));
#else
info.setDateTime(QDateTime(date.startOfDay()));
info.setLastDateTimeSend(QDateTime(date.startOfDay()));
#endif
SendLaterUtil::writeSendLaterInfo(KSharedConfig::openConfig(), &info);
KConfigGroup grp(KSharedConfig::openConfig(), SendLaterUtil::sendLaterPattern().arg(42));
......
......@@ -29,7 +29,7 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
endif()
target_link_libraries(ktnef
Qt5::Widgets
Qt::Widgets
KF5::Tnef
KF5::DBusAddons
KF5::Crash
......
......@@ -11,44 +11,44 @@ set( kmail_displaymenu_source displaymessageformatactionmenutest.cpp)
add_executable( displaymessageformatactionmenutest ${kmail_displaymenu_source} )
add_test(NAME displaymessageformatactionmenutest COMMAND displaymessageformatactionmenutest )
ecm_mark_as_test(kmail-displaymessageformatactionmenutest)
target_link_libraries( displaymessageformatactionmenutest Qt5::Test KF5::MessageViewer KF5::I18n kmailprivate)
target_link_libraries( displaymessageformatactionmenutest Qt::Test KF5::MessageViewer KF5::I18n kmailprivate)
#####
set( kmail_identityaddvcarddialog_source identityaddvcarddialogtest.cpp )
add_executable( identityaddvcarddialogtest ${kmail_identityaddvcarddialog_source})
ecm_mark_as_test(kmail-identityaddvcarddialogtest)
target_link_libraries( identityaddvcarddialogtest Qt5::Test Qt5::Widgets KF5::Completion KF5::KIOWidgets KF5::I18n kmailprivate)
target_link_libraries( identityaddvcarddialogtest Qt::Test Qt5::Widgets KF5::Completion KF5::KIOWidgets KF5::I18n kmailprivate)
#####
set( kmail_createfollowupreminderonexistingmessagejobtest_source createfollowupreminderonexistingmessagejobtest.cpp)
add_executable( createfollowupreminderonexistingmessagejobtest ${kmail_createfollowupreminderonexistingmessagejobtest_source})
ecm_mark_as_test(kmail_createfollowupreminderonexistingmessagejobtest)
target_link_libraries( createfollowupreminderonexistingmessagejobtest Qt5::Test Qt5::Widgets KF5::AkonadiCore KF5::CalendarCore KF5::Mime KF5::MessageComposer kmailprivate)
target_link_libraries( createfollowupreminderonexistingmessagejobtest Qt::Test Qt5::Widgets KF5::AkonadiCore KF5::CalendarCore KF5::Mime KF5::MessageComposer kmailprivate)
#####
set( kmail_cryptostateindicatorwidgettest_source cryptostateindicatorwidgettest.cpp)
add_executable( cryptostateindicatorwidgettest ${kmail_cryptostateindicatorwidgettest_source})
add_test(NAME cryptostateindicatorwidgettest COMMAND cryptostateindicatorwidgettest)
ecm_mark_as_test(cryptostateindicatorwidgettest)
target_link_libraries( cryptostateindicatorwidgettest Qt5::Test KF5::MessageCore Qt5::Widgets KF5::ConfigWidgets KF5::I18n kmailprivate)
target_link_libraries( cryptostateindicatorwidgettest Qt::Test KF5::MessageCore Qt5::Widgets KF5::ConfigWidgets KF5::I18n kmailprivate)
#####
set( kmail_kactionmenutransporttest_source kactionmenutransporttest.cpp)
add_executable( kactionmenutransporttest ${kmail_kactionmenutransporttest_source})
add_test(NAME kactionmenutransporttest COMMAND kactionmenutransporttest)
ecm_mark_as_test(kactionmenutransporttest)
target_link_libraries( kactionmenutransporttest Qt5::Test KF5::MailTransportAkonadi KF5::WidgetsAddons KF5::I18n KF5::ConfigGui kmailprivate)
target_link_libraries( kactionmenutransporttest Qt::Test KF5::MailTransportAkonadi KF5::WidgetsAddons KF5::I18n KF5::ConfigGui kmailprivate)
if (KDEPIM_RUN_AKONADI_TEST)
set(KDEPIMLIBS_RUN_ISOLATED_TESTS TRUE)
set(KDEPIMLIBS_RUN_SQLITE_ISOLATED_TESTS TRUE)
add_akonadi_isolated_test_advanced( kmcomposerwintest.cpp ""
"Qt5::Test;KF5::IdentityManagement;KF5::MessageCore;KF5::TemplateParser;KF5::XmlGui;Qt5::Widgets;KF5::ConfigWidgets;KF5::I18n;kmailprivate")
"Qt::Test;KF5::IdentityManagement;KF5::MessageCore;KF5::TemplateParser;KF5::XmlGui;Qt5::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 ""
"Qt5::Test;Qt5::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::Test;Qt5::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")
endif()
......@@ -4,20 +4,20 @@ set( kmail_potentialphishingemailjobtest_SRCS potentialphishingemailjobtest.cpp
add_executable( kmail_potentialphishingemailjobtest ${kmail_potentialphishingemailjobtest_SRCS})
add_test(NAME kmail_potentialphishingemailjobtest COMMAND kmail_potentialphishingemailjobtest)
ecm_mark_as_test(kmail_potentialphishingemailjobtest)
target_link_libraries( kmail_potentialphishingemailjobtest Qt5::Test KF5::PimCommon kmailprivate)
target_link_libraries( kmail_potentialphishingemailjobtest Qt::Test KF5::PimCommon kmailprivate)
set( kmail_potentialphishingdetaildialogtest_SRCS potentialphishingdetaildialogtest.cpp)
add_executable( kmail_potentialphishingdetaildialogtest ${kmail_potentialphishingdetaildialogtest_SRCS})
add_test(NAME kmail_potentialphishingdetaildialogtest COMMAND kmail_potentialphishingdetaildialogtest)
ecm_mark_as_test(kmail_potentialphishingdetaildialogtest)
target_link_libraries( kmail_potentialphishingdetaildialogtest Qt5::Test Qt5::Widgets KF5::ConfigCore KF5::I18n KF5::WidgetsAddons kmailprivate)
target_link_libraries( kmail_potentialphishingdetaildialogtest Qt::Test Qt5::Widgets KF5::ConfigCore KF5::I18n KF5::WidgetsAddons kmailprivate)
set( kmail_potentialphishingdetailwidgettest_SRCS potentialphishingdetailwidgettest.cpp)
add_executable( kmail_potentialphishingdetailwidgettest ${kmail_potentialphishingdetailwidgettest_SRCS})
add_test(NAME kmail_potentialphishingdetailwidgettest COMMAND kmail_potentialphishingdetailwidgettest)
ecm_mark_as_test(kmail_potentialphishingdetailwidgettest)
target_link_libraries( kmail_potentialphishingdetailwidgettest Qt5::Test Qt5::Widgets KF5::ConfigCore KF5::I18n KF5::WidgetsAddons KF5::PimCommon kmailprivate)
target_link_libraries( kmail_potentialphishingdetailwidgettest Qt::Test Qt5::Widgets KF5::ConfigCore KF5::I18n KF5::WidgetsAddons KF5::PimCommon kmailprivate)
......@@ -26,7 +26,7 @@ set( kmail_potentialphishingemailwarningtest_SRCS potentialphishingemailwarningt
add_executable( kmail_potentialphishingemailwarningtest ${kmail_potentialphishingemailwarningtest_SRCS})
add_test(NAME kmail_potentialphishingemailwarningtest COMMAND kmail_potentialphishingemailwarningtest)
ecm_mark_as_test(kmail_potentialphishingemailwarningtest)
target_link_libraries( kmail_potentialphishingemailwarningtest Qt5::Test Qt5::Widgets KF5::ConfigCore KF5::I18n KF5::WidgetsAddons kmailprivate)
target_link_libraries( kmail_potentialphishingemailwarningtest Qt::Test Qt5::Widgets KF5::ConfigCore KF5::I18n KF5::WidgetsAddons kmailprivate)
......@@ -4,11 +4,11 @@ set( kmail_incorrectidentityfolderwarningtest_SRCS incorrectidentityfolderwarnin
add_executable( kmail_incorrectidentityfolderwarningtest ${kmail_incorrectidentityfolderwarningtest_SRCS})
add_test(NAME kmail_incorrectidentityfolderwarningtest COMMAND kmail_incorrectidentityfolderwarningtest)
ecm_mark_as_test(kmail_incorrectidentityfolderwarningtest)
target_link_libraries( kmail_incorrectidentityfolderwarningtest Qt5::Test KF5::PimCommon KF5::I18n kmailprivate)
target_link_libraries( kmail_incorrectidentityfolderwarningtest Qt::Test KF5::PimCommon KF5::I18n kmailprivate)
set( kmail_externaleditorwarningtest_SRCS externaleditorwarningtest.cpp)
add_executable( kmail_externaleditorwarningtest ${kmail_externaleditorwarningtest_SRCS})
add_test(NAME kmail_externaleditorwarningtest COMMAND kmail_externaleditorwarningtest)
ecm_mark_as_test(kmail_externaleditorwarningtest)
target_link_libraries( kmail_externaleditorwarningtest Qt5::Test KF5::PimCommon KF5::I18n kmailprivate)
target_link_libraries( kmail_externaleditorwarningtest Qt::Test KF5::PimCommon KF5::I18n kmailprivate)
......@@ -7,7 +7,7 @@ macro( folderarchive_kmail _source )
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(folderararchive-${_name})
target_link_libraries( ${_name} Qt5::Test Qt5::Core KF5::AkonadiCore KF5::ConfigCore kmailprivate)
target_link_libraries( ${_name} Qt::Test Qt5::Core KF5::AkonadiCore KF5::ConfigCore kmailprivate)
endmacro()
folderarchive_kmail(folderarchiveaccountinfotest.cpp)
......@@ -2,7 +2,7 @@ macro(add_kmail_job_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source}
TEST_NAME ${_name}
LINK_LIBRARIES kmailprivate Qt5::Test Qt5::Widgets KF5::AkonadiCore
LINK_LIBRARIES kmailprivate Qt::Test Qt5::Widgets KF5::AkonadiCore
)
endmacro ()
......
......@@ -28,7 +28,7 @@ add_library(kcm_kmailsummary MODULE ${kcm_kmailsummary_PART_SRCS})
pim_target_precompile_headers(kcm_kmailsummary PUBLIC ../../../kmail_pch.h)
add_dependencies(kcm_kmailsummary kmail_xml)
target_link_libraries(kcm_kmailsummary KF5::Mime KF5::PimCommonAkonadi Qt5::DBus KF5::ConfigWidgets KF5::I18n)
target_link_libraries(kcm_kmailsummary KF5::Mime KF5::PimCommonAkonadi Qt::DBus KF5::ConfigWidgets KF5::I18n)
########### install files ###############
......
......@@ -20,7 +20,7 @@ set(kcm_kontactsummary_PART_SRCS kcmkontactsummary.cpp)
add_library(kcm_kontactsummary MODULE ${kcm_kontactsummary_PART_SRCS})
pim_target_precompile_headers(kcm_kontactsummary PUBLIC ../../../kmail_pch.h)
target_link_libraries(kcm_kontactsummary KF5::KCMUtils Qt5::Widgets KF5::KCMUtils KF5::I18n KF5::KontactInterface)
target_link_libraries(kcm_kontactsummary KF5::KCMUtils Qt::Widgets KF5::KCMUtils KF5::I18n KF5::KontactInterface)
########### install files ###############
......
......@@ -5,17 +5,17 @@ set(dbustest_SRCS dbustest.cpp)
qt5_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 Qt5::DBus)
target_link_libraries(dbustest KF5::KIOCore KF5::I18n Qt::DBus)
#####
set(searchdbustest_SRCS searchdbustest.cpp)
add_executable(searchdbustest ${searchdbustest_SRCS})
target_link_libraries(searchdbustest Qt5::DBus Qt5::Widgets KF5::PimCommonAkonadi)
target_link_libraries(searchdbustest Qt::DBus Qt5::Widgets KF5::PimCommonAkonadi)
#####
set(ktoolinvocationtest_SRCS ktoolinvocationtest.cpp)
add_executable(ktoolinvocationtest ${ktoolinvocationtest_SRCS})
target_link_libraries(ktoolinvocationtest Qt5::DBus KF5::Service KF5::I18n)
target_link_libraries(ktoolinvocationtest Qt::DBus KF5::Service KF5::I18n)
#####
set(searchmailertest_SRCS searchmailertest.cpp)
......
......@@ -2,7 +2,7 @@ macro(add_kmail_undosend_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source}
TEST_NAME ${_name}
LINK_LIBRARIES kmailprivate Qt5::Test Qt5::Widgets
LINK_LIBRARIES kmailprivate Qt::Test Qt5::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