Commit 2ba90e0a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

CMake 3.16 has pch support

parent f10174e3
Pipeline #50446 passed with stage
in 25 minutes and 5 seconds
......@@ -165,7 +165,7 @@ 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)
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) # Set to OFF when using clazy and such
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
......@@ -175,6 +175,23 @@ if (USE_UNITY_CMAKE_SUPPORT)
endif()
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})
endif()
endif()
endmacro()
add_subdirectory(src)
add_subdirectory(agents)
add_subdirectory(ktnef)
......
......@@ -25,6 +25,7 @@ ecm_qt_declare_logging_category(libarchivemailagent_SRCS HEADER archivemailagent
ki18n_wrap_ui(libarchivemailagent_SRCS ui/archivemailwidget.ui )
add_library(archivemailagent STATIC ${libarchivemailagent_SRCS})
pim_target_precompile_headers(archivemailagent PUBLIC ../../kmail_pch.h)
#if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
# set_target_properties(archivemailagent PROPERTIES UNITY_BUILD ON)
#endif()
......
......@@ -33,6 +33,7 @@ qt5_add_dbus_interface(followupreminderagent_SRCS org.freedesktop.DBus.Propertie
add_library(followupreminderagent STATIC ${followupreminderagent_SRCS})
pim_target_precompile_headers(followupreminderagent PUBLIC ../../kmail_pch.h)
#if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
# set_target_properties(followupreminderagent PROPERTIES UNITY_BUILD ON)
#endif()
......
......@@ -37,6 +37,7 @@ qt5_add_dbus_adaptor(sendlateragent_SRCS org.freedesktop.Akonadi.SendLaterAgent.
ki18n_wrap_ui(libsendlateragent_SRCS ui/sendlaterconfigurewidget.ui)
kconfig_add_kcfg_files(libsendlateragent_SRCS sendlateragentsettings.kcfgc)
add_library(sendlateragent STATIC ${libsendlateragent_SRCS})
pim_target_precompile_headers(sendlateragent PUBLIC ../../kmail_pch.h)
#if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
# set_target_properties(sendlateragent PROPERTIES UNITY_BUILD ON)
#endif()
......
#pragma once
#include <QAbstractItemModel>
#include <QAbstractItemView>
#include <QAction>
#include <QApplication>
#include <QBuffer>
#include <QButtonGroup>
#include <QByteArray>
#include <QCheckBox>
#include <QClipboard>
#include <QCloseEvent>
#include <QColor>
#include <QColorDialog>
#include <QComboBox>
#include <QCommandLineParser>
#include <QContextMenuEvent>
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QCursor>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
#include <QDBusMessage>
#include <QDBusMetaType>
#include <QDBusObjectPath>
#include <QDBusPendingCallWatcher>
#include <QDBusPendingReply>
#include <QDBusReply>
#include <QDBusServiceWatcher>
#include <QDataStream>
#include <QDate>
#include <QDateTime>
#include <QDebug>
#include <QDialog>
#include <QDialogButtonBox>
#include <QDir>
#include <QDrag>
#include <QDragEnterEvent>
#include <QDragLeaveEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QEvent>
#include <QEventLoop>
#include <QFile>
#include <QFileDialog>
#include <QFileInfo>
#include <QFont>
#include <QFontDatabase>
#include <QFormLayout>
#include <QGpgME/CryptoConfig>
#include <QGpgME/ExportJob>
#include <QGpgME/Job>
#include <QGpgME/KeyForMailboxJob>
#include <QGpgME/Protocol>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QHash>
#include <QHeaderView>
#include <QHideEvent>
#include <QHostInfo>
#include <QIcon>
#include <QImage>
#include <QImageReader>
#include <QInputDialog>
#include <QItemSelectionModel>
#include <QKeyEvent>
#include <QLabel>
#include <QLayout>
#include <QLineEdit>
#include <QList>
#include <QListView>
#include <QListWidget>
#include <QListWidgetItem>
#include <QLocale>
#include <QMap>
#include <QMenu>
#include <QMenuBar>
#include <QMessageBox>
#include <QMetaType>
#include <QMimeData>
#include <QMimeDatabase>
#include <QMimeType>
#include <QModelIndex>
#include <QMouseEvent>
#include <QNetworkConfigurationManager>
#include <QObject>
#include <QPainter>
#include <QPainterPath>
#include <QPalette>
#include <QPixmap>
#include <QPlainTextEdit>
#include <QPointer>
#include <QPolygon>
#include <QProcess>
#include <QProgressBar>
#include <QProgressDialog>
#include <QPushButton>
#include <QQueue>
#include <QRadioButton>
#include <QRect>
#include <QRegularExpression>
#include <QRegularExpressionValidator>
#include <QScrollArea>
#include <QSessionManager>
#include <QSet>
#include <QSettings>
#include <QSharedPointer>
#include <QShortcut>
#include <QShowEvent>
#include <QSortFilterProxyModel>
#include <QSpacerItem>
#include <QSpinBox>
#include <QSplitter>
#include <QStackedWidget>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QStandardPaths>
#include <QStatusBar>
#include <QString>
#include <QStringList>
#include <QStyledItemDelegate>
#include <QTabWidget>
#include <QTemporaryDir>
#include <QTemporaryFile>
#include <QTextCodec>
#include <QTextDocument>
#include <QTextDocumentWriter>
#include <QTimer>
#include <QToolButton>
#include <QTransform>
#include <QTreeView>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QUrl>
#include <QVBoxLayout>
#include <QVariant>
#include <QVariantList>
#include <QVector>
#include <QWhatsThis>
#include <QWidget>
......@@ -317,6 +317,7 @@ endif()
add_library(kmailprivate ${kmailprivate_LIB_SRCS})
pim_target_precompile_headers(kmailprivate PUBLIC ../kmail_pch.h)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(kmailprivate PROPERTIES UNITY_BUILD ON)
endif()
......@@ -374,6 +375,7 @@ set_target_properties(kmailprivate
########### kcm_kmail ###############
set(kcm_kmail_PART_SRCS kcm_kmail.cpp )
add_library(kcm_kmail MODULE ${kcm_kmail_PART_SRCS})
pim_target_precompile_headers(kcm_kmail PUBLIC ../kmail_pch.h)
target_link_libraries(kcm_kmail kmailprivate KF5::KCMUtils KF5::Completion KF5::I18n KF5::TextWidgets)
########### kmailpart ###############
......@@ -385,6 +387,7 @@ qt5_add_dbus_adaptor(kmailpart_PART_SRCS
)
qt5_add_dbus_interfaces(kmailpart_PART_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml)
add_library(kmailpart MODULE ${kmailpart_PART_SRCS})
pim_target_precompile_headers(kmailpart PUBLIC ../kmail_pch.h)
target_link_libraries(kmailpart
kmailprivate
......
......@@ -15,6 +15,7 @@ qt5_add_dbus_interfaces(kontact_kmail_plugins_interface_SRCS ${kmail_BINARY_DIR}
set(kontact_kmailplugin_PART_SRCS kmail_plugin.cpp summarywidget.cpp ${kontact_kmail_plugins_interface_SRCS} ${kontact_kmail_plugins_interface_common_SRCS})
add_library(kontact_kmailplugin MODULE ${kontact_kmailplugin_PART_SRCS})
pim_target_precompile_headers(kontact_kmailplugin PUBLIC ../../../kmail_pch.h)
add_dependencies(kontact_kmailplugin kmail_xml)
target_link_libraries(kontact_kmailplugin KF5::Mime KF5::KontactInterface KF5::CalendarCore KF5::CalendarUtils KF5::AkonadiCore KF5::Contacts KF5::AkonadiWidgets)
......@@ -24,6 +25,7 @@ target_link_libraries(kontact_kmailplugin KF5::Mime KF5::KontactInterface KF5::
set(kcm_kmailsummary_PART_SRCS kcmkmailsummary.cpp ${kontact_kmail_plugins_interface_SRCS} ${kontact_kmail_plugins_interface_common_SRCS})
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)
......
......@@ -6,6 +6,7 @@ set(kontact_summaryplugin_PART_SRCS summaryview_plugin.cpp summaryview_part.cpp
qt5_add_dbus_interfaces(kontact_summaryplugin_PART_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml)
add_library(kontact_summaryplugin MODULE ${kontact_summaryplugin_PART_SRCS})
pim_target_precompile_headers(kontact_summaryplugin PUBLIC ../../../kmail_pch.h)
add_dependencies(kontact_summaryplugin kmail_xml)
target_link_libraries(kontact_summaryplugin KF5::KCMUtils KF5::IdentityManagement KF5::KontactInterface KF5::PimCommon KF5::ConfigCore)
......@@ -17,6 +18,7 @@ kcoreaddons_desktop_to_json(kontact_summaryplugin summaryplugin.desktop)
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)
......
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