Commit 005246fe authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to use UNITY build see...

Allow to use UNITY build see https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html (Reduce compile time. Need cmake 3.16.0)
parent 5b32d21c
Pipeline #44122 passed with stage
in 60 minutes and 10 seconds
......@@ -170,6 +170,16 @@ if(discount_FOUND)
endif()
endif()
option(USE_UNIFY_CMAKE_SUPPORT "Use UNIFY cmake support (speedup compile time)" FALSE)
set(COMPILE_WITH_CMAKE_SUPPORT false)
if (USE_UNIFY_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_CMAKE_SUPPORT true)
endif()
endif()
add_subdirectory(plugins)
add_subdirectory(korganizer)
add_subdirectory(kmail)
......
......@@ -11,7 +11,9 @@ set(kaddressbook_importexport_csv_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportcsvplugin JSON kaddressbook_importexportcsvplugin.json SOURCES
${kaddressbook_importexport_csv_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_importexportcsvplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_importexportcsvplugin
KPim::AddressbookImportExport
KF5::PimCommon
......
......@@ -11,7 +11,9 @@ ecm_qt_declare_logging_category(kaddressbook_importexport_gmx_SRCS HEADER kaddre
kcoreaddons_add_plugin(kaddressbook_importexportgmxplugin JSON kaddressbook_importexportgmxplugin.json SOURCES
${kaddressbook_importexport_gmx_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_importexportgmxplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_importexportgmxplugin
KPim::AddressbookImportExport
KF5::PimCommon
......
......@@ -6,6 +6,9 @@ set(kaddressbook_importexport_ldap_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportldapplugin JSON kaddressbook_importexportldapplugin.json SOURCES
${kaddressbook_importexport_ldap_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_importexportldapplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_importexportldapplugin
KPim::AddressbookImportExport
......
......@@ -6,6 +6,9 @@ set(kaddressbook_importexport_ldif_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportldifplugin JSON kaddressbook_importexportldifplugin.json SOURCES
${kaddressbook_importexport_ldif_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_importexportldifplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_importexportldifplugin
KPim::AddressbookImportExport
......
......@@ -8,6 +8,9 @@ set(kaddressbook_importexport_vcard_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportvcardplugin JSON kaddressbook_importexportvcardplugin.json SOURCES
${kaddressbook_importexport_vcard_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_importexportvcardplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_importexportvcardplugin
KPim::AddressbookImportExport
......
......@@ -13,6 +13,9 @@ set(kaddressbook_importexport_windowscontact_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportwindowscontactplugin JSON kaddressbook_importexportwindowscontactplugin.json SOURCES
${kaddressbook_importexport_windowscontact_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_importexportwindowscontactplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_importexportwindowscontactplugin
KPim::AddressbookImportExport
......
......@@ -22,6 +22,9 @@ ecm_qt_declare_logging_category(kaddressbook_checkgravatarplugin_SRCS HEADER kad
kcoreaddons_add_plugin(kaddressbook_checkgravatarplugin JSON kaddressbook_checkgravatarplugin.json SOURCES
${kaddressbook_checkgravatarplugin_SRCS} INSTALL_NAMESPACE kaddressbook/mainview)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_checkgravatarplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_checkgravatarplugin
KF5::PimCommon KF5::Completion KF5::PimCommonAkonadi KF5::XmlGui KF5::Gravatar KF5::I18n KF5::Contacts
......
......@@ -6,6 +6,9 @@ set(kaddressbook_mergecontactsplugin_SRCS
kcoreaddons_add_plugin(kaddressbook_mergecontactsplugin JSON kaddressbook_mergecontactsplugin.json SOURCES
${kaddressbook_mergecontactsplugin_SRCS} INSTALL_NAMESPACE kaddressbook/mainview)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_mergecontactsplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_mergecontactsplugin
KF5::PimCommon KF5::Completion KF5::PimCommonAkonadi KF5::XmlGui kaddressbookmergelibprivate KF5::I18n
......
......@@ -27,6 +27,9 @@ ecm_qt_declare_logging_category(kaddressbookmergelibprivate_SRCS HEADER kaddress
add_library(kaddressbookmergelibprivate ${kaddressbookmergelibprivate_SRCS})
generate_export_header(kaddressbookmergelibprivate BASE_NAME kaddressbookmergelib)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbookmergelibprivate PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbookmergelibprivate
......
......@@ -23,7 +23,7 @@
using namespace KABMergeContacts;
namespace {
static const char myConfigGroupName[] = "SearchAndMergeContactDuplicateContactDialog";
static const char mySearchAndMergeContactDuplicateContactDialogGroupName[] = "SearchAndMergeContactDuplicateContactDialog";
}
SearchAndMergeContactDuplicateContactDialog::SearchAndMergeContactDuplicateContactDialog(QWidget *parent)
: QDialog(parent)
......@@ -93,7 +93,7 @@ void SearchAndMergeContactDuplicateContactDialog::searchPotentialDuplicateContac
void SearchAndMergeContactDuplicateContactDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup grp(KSharedConfig::openConfig(), mySearchAndMergeContactDuplicateContactDialogGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
......@@ -102,7 +102,7 @@ void SearchAndMergeContactDuplicateContactDialog::readConfig()
void SearchAndMergeContactDuplicateContactDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup grp(KSharedConfig::openConfig(), mySearchAndMergeContactDuplicateContactDialogGroupName);
grp.writeEntry("Size", size());
grp.sync();
}
......
......@@ -5,6 +5,9 @@ set(kaddressbook_searchduplicatesplugin_SRCS
kcoreaddons_add_plugin(kaddressbook_searchduplicatesplugin JSON kaddressbook_searchduplicatesplugin.json SOURCES
${kaddressbook_searchduplicatesplugin_SRCS} INSTALL_NAMESPACE kaddressbook/mainview)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_searchduplicatesplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_searchduplicatesplugin
KF5::PimCommon KF5::Completion KF5::PimCommonAkonadi KF5::XmlGui kaddressbookmergelibprivate KF5::I18n
......
......@@ -18,6 +18,9 @@ ecm_qt_declare_logging_category(kaddressbook_sendmailplugin_SRCS HEADER kaddress
kcoreaddons_add_plugin(kaddressbook_sendmailplugin JSON kaddressbook_sendmailplugin.json SOURCES
${kaddressbook_sendmailplugin_SRCS} INSTALL_NAMESPACE kaddressbook/mainview)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_sendmailplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_sendmailplugin
KF5::PimCommon KF5::Completion KF5::PimCommonAkonadi KF5::XmlGui KF5::I18n
......
......@@ -19,6 +19,9 @@ kcoreaddons_add_plugin(kaddressbook_sendvcardsplugin JSON kaddressbook_sendvcard
${kaddressbook_sendvcardsplugin_SRCS} INSTALL_NAMESPACE kaddressbook/mainview)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_sendvcardsplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_sendvcardsplugin
KF5::PimCommon KF5::Completion KF5::PimCommonAkonadi KF5::XmlGui KF5::MimeTreeParser KF5::I18n
)
......
......@@ -16,6 +16,9 @@ set(kmailmarkdownlib_SRCS
add_library(kmailmarkdown ${kmailmarkdownlib_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmailmarkdown PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(kmailmarkdown BASE_NAME libkmailmarkdown)
target_link_libraries(kmailmarkdown
KF5::MessageComposer
......
......@@ -8,6 +8,9 @@ ecm_qt_declare_logging_category(kmail_markdownplugin_SRCS HEADER markdownplugin_
kcoreaddons_add_plugin(kmail_markdownplugin JSON kmail_markdownplugin.json SOURCES
${kmail_markdownplugin_SRCS} INSTALL_NAMESPACE kmail/plugineditorconverttext)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmail_markdownplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kmail_markdownplugin PRIVATE
KF5::I18n KF5::XmlGui
......
......@@ -7,6 +7,9 @@ set(kmail_externalcomposereditorplugin_SRCS
kcoreaddons_add_plugin(kmail_externalcomposereditorplugin JSON kmail_externalcomposereditorplugin.json SOURCES
${kmail_externalcomposereditorplugin_SRCS} INSTALL_NAMESPACE kmail/plugineditorinit)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmail_externalcomposereditorplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kmail_externalcomposereditorplugin
KF5::MessageComposer KF5::XmlGui KF5::I18n KF5::KIOWidgets
......
......@@ -9,6 +9,9 @@ kcoreaddons_add_plugin(kmail_autocorrectioneditorplugin JSON kmail_autocorrectio
target_link_libraries(kmail_autocorrectioneditorplugin
KF5::MessageComposer KF5::XmlGui KF5::I18n
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmail_autocorrectioneditorplugin PROPERTIES UNITY_BUILD ON)
endif()
if(BUILD_TESTING)
add_subdirectory(autotests)
......
......@@ -11,6 +11,9 @@ ecm_qt_declare_logging_category(kmail_changecaseeditorplugin_SRCS HEADER changec
kcoreaddons_add_plugin(kmail_changecaseeditorplugin JSON kmail_changecaseeditorplugin.json SOURCES
${kmail_changecaseeditorplugin_SRCS} INSTALL_NAMESPACE kmail/plugineditor)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmail_changecaseeditorplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kmail_changecaseeditorplugin
KF5::MessageComposer KF5::XmlGui KF5::I18n
......
......@@ -11,6 +11,9 @@ kcoreaddons_add_plugin(kmail_insertemaileditorplugin JSON kmail_insertemailedito
target_link_libraries(kmail_insertemaileditorplugin
KF5::MessageComposer KF5::XmlGui KF5::I18n KF5::AkonadiContact
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmail_insertemaileditorplugin PROPERTIES UNITY_BUILD ON)
endif()
if(BUILD_TESTING)
add_subdirectory(autotests)
......
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