Commit ec8341a5 authored by Laurent Montel's avatar Laurent Montel 😁

MAke it installable

parent 928945d5
project(incidenceeditorng)
add_definitions(-DTRANSLATION_DOMAIN=\"libincidenceeditors\")
set(incidenceeditors_ng_shared_LIB_SRCS
attachmenteditdialog.cpp
attachmenticonview.cpp
attendeedata.cpp
attendeeline.cpp
attendeecomboboxdelegate.cpp
attendeelineeditdelegate.cpp
attendeetablemodel.cpp
attendeeeditor.cpp
alarmpresets.cpp
alarmdialog.cpp
incidenceeditorsettings.cpp
ktimezonecombobox.cpp
# TODO: Move the next two to akonadi libs when finished
editoritemmanager.cpp
freebusyurldialog.cpp
# Shared incidence editors code
combinedincidenceeditor.cpp
incidenceeditor.cpp
# Specific editors
incidencealarm.cpp
incidenceattachment.cpp
incidenceattendee.cpp
incidencecategories.cpp
incidencecompletionpriority.cpp
incidencedescription.cpp
incidencewhatwhere.cpp
incidencedatetime.cpp
incidencerecurrence.cpp
incidenceresource.cpp
incidencesecrecy.cpp
freebusyganttproxymodel.cpp
conflictresolver.cpp
schedulingdialog.cpp
groupwareuidelegate.cpp
incidencedefaults.cpp
editorconfig.cpp
korganizereditorconfig.cpp
autochecktreewidget.cpp
categoryeditdialog.cpp
categoryselectdialog.cpp
categorydialog.cpp
# Individual mail
individualmailcomponentfactory.cpp
individualmaildialog.cpp
opencomposerjob.cpp
# Resourcemanagement
ldaputils.cpp
resourcemanagement.cpp
resourceitem.cpp
resourcemodel.cpp
cmake_minimum_required(VERSION 2.8.12)
project(incidenceeditorsng)
if(${CMAKE_SOURCE_DIR} STREQUAL ${incidenceeditorsng_SOURCE_DIR})
# ECM setup
find_package(ECM 5.14.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(KF5_VERSION "5.14.0")
set(KDEPIMLIBS_LIB_VERSION "5.0.42")
set(KDEPIM_LIB_VERSION "5.43.0")
set(QT_REQUIRED_VERSION "5.4.0")
set(KMIME_LIB_VERSION "4.87.0")
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX INCIDENCEEDITORSNG
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/incidenceeditorsng_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorsngConfigVersion.cmake"
SOVERSION 5
)
ecm_qt_declare_logging_category(incidenceeditors_ng_shared_LIB_SRCS HEADER incidenceeditor_debug.h IDENTIFIER INCIDENCEEDITOR_LOG CATEGORY_NAME log_incidenceeditor)
kconfig_add_kcfg_files(incidenceeditors_ng_shared_LIB_SRCS globalsettings_incidenceeditor.kcfgc)
########### Targets ###########
### Build the desktop version
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
set(incidenceeditors_ng_desktop_LIB_SRCS
${incidenceeditors_ng_shared_LIB_SRCS}
templatemanagementdialog.cpp
incidencedialogfactory.cpp
incidencedialog.cpp
visualfreebusywidget.cpp
)
ki18n_wrap_ui(incidenceeditors_ng_desktop_LIB_SRCS
ui/categoryeditdialog_base.ui
ui/categoryselectdialog_base.ui
ui/categorydialog_base.ui
ui/template_management_dialog_base.ui
ui/dialogdesktop.ui
ui/alarmdialog.ui
ui/attachmenteditdialog.ui
ui/schedulingdialog.ui
ui/resourcemanagement.ui
)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IncidenceEditorsng")
add_library(incidenceeditorsng ${incidenceeditors_ng_desktop_LIB_SRCS})
generate_export_header(incidenceeditorsng BASE_NAME incidenceeditors_ng)
target_link_libraries(incidenceeditorsng
PUBLIC
KF5::AkonadiCalendar
KF5::AkonadiMime
KF5::CalendarCore
KF5::CalendarUtils
KF5::MailTransport
KF5::CalendarSupport # For KCalPrefs
eventviews
kdgantt2 # For FreeBusy Editor
PRIVATE
KF5::Libkdepim
kdepimdbusinterfaces # For UriHandler
KF5::Codecs
KF5::Ldap
KF5::AkonadiWidgets
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5IncidenceEditorsngConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorsngConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
set_target_properties(incidenceeditorsng
PROPERTIES VERSION ${KDEPIM_LIB_VERSION}
SOVERSION ${KDEPIM_LIB_SOVERSION}
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorsngConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorsngConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(TARGETS incidenceeditorsng ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
target_include_directories(incidenceeditorsng PUBLIC "$<BUILD_INTERFACE:${incidenceeditorng_SOURCE_DIR};${incidenceeditorng_BINARY_DIR}>")
install(EXPORT KF5IncidenceEditorsngTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5IncidenceEditorsngTargets.cmake NAMESPACE KF5::)
set(testincidenceeditor_SRCS main.cpp)
add_executable(kincidenceeditor ${testincidenceeditor_SRCS})
target_link_libraries(kincidenceeditor
KF5::AkonadiCalendar
KF5::AkonadiCore
KF5::CalendarCore
KF5::CalendarUtils
incidenceeditorsng
KF5::CalendarSupport
kdepimdbusinterfaces
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/incidenceeditorsng_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
install(TARGETS kincidenceeditor ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
else()
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX INCIDENCEEDITORSNG
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/incidenceeditorsng_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorsngConfigVersion.cmake"
SOVERSION 5
)
endif()
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(autotests)
add_subdirectory(tests)
......
......@@ -9,14 +9,14 @@ MACRO(IE_UNIT_TESTS)
add_executable( ${_testname} ${_testname}.cpp modeltest.cpp )
add_test( ${_testname} ${_testname} )
ecm_mark_as_test(${_testname})
target_link_libraries(${_testname} Qt5::Test KF5::AkonadiCore kdgantt2 KF5::CalendarUtils KF5::CalendarCore incidenceeditorsng kdepimdbusinterfaces KF5::Libkdepim)
target_link_libraries(${_testname} Qt5::Test KF5::AkonadiCore kdgantt2 KF5::CalendarUtils KF5::CalendarCore KF5::IncidenceEditorsng kdepimdbusinterfaces KF5::Libkdepim)
ENDFOREACH(_testname)
ENDMACRO(IE_UNIT_TESTS)
MACRO(IE_EXECUTABLE_TESTS)
FOREACH(_testname ${ARGN})
add_executable(${_testname} NOGUI TEST ${_testname}.cpp modeltest.cpp)
target_link_libraries(${_testname} KF5::CalendarCore Qt5::Test incidenceeditorsng)
target_link_libraries(${_testname} KF5::CalendarCore Qt5::Test KF5::IncidenceEditorsng)
ENDFOREACH(_testname)
ENDMACRO(IE_EXECUTABLE_TESTS)
......@@ -36,10 +36,10 @@ target_link_libraries(
ktimezonecomboboxtest
KF5::CalendarCore
Qt5::Test
incidenceeditorsng
KF5::IncidenceEditorsng
)
add_executable(testindividualmaildialog testindividualmaildialog.cpp ../individualmaildialog.cpp)
add_executable(testindividualmaildialog testindividualmaildialog.cpp ../src/individualmaildialog.cpp)
ecm_mark_nongui_executable(testindividualmaildialog)
ecm_mark_as_test(testindividualmaildialog)
target_link_libraries(testindividualmaildialog
......
......@@ -19,7 +19,7 @@
*/
#include "conflictresolvertest.h"
#include "../conflictresolver.h"
#include "../src/conflictresolver.h"
#include <KCalCore/Event>
#include <KCalCore/Period>
......
......@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ktimezonecomboboxtest.h"
#include "../ktimezonecombobox.h"
#include "../src/ktimezonecombobox.h"
#include "qtest.h"
......
......@@ -22,7 +22,7 @@
#include "modeltest.h"
#include "freebusymodel/freebusyitem.h"
#include "freebusymodel/freebusyitemmodel.h"
#include "../freebusyganttproxymodel.h"
#include "../src/freebusyganttproxymodel.h"
#include <kdgantt2/kdganttgraphicsview.h>
......
......@@ -17,7 +17,7 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "individualmaildialog.h"
#include "../src/individualmaildialog.h"
#include <QObject>
#include <qtest.h>
......
add_definitions(-DTRANSLATION_DOMAIN=\"libincidenceeditors\")
set(incidenceeditors_ng_shared_LIB_SRCS
attachmenteditdialog.cpp
attachmenticonview.cpp
attendeedata.cpp
attendeeline.cpp
attendeecomboboxdelegate.cpp
attendeelineeditdelegate.cpp
attendeetablemodel.cpp
attendeeeditor.cpp
alarmpresets.cpp
alarmdialog.cpp
incidenceeditorsettings.cpp
ktimezonecombobox.cpp
# TODO: Move the next two to akonadi libs when finished
editoritemmanager.cpp
freebusyurldialog.cpp
# Shared incidence editors code
combinedincidenceeditor.cpp
incidenceeditor.cpp
# Specific editors
incidencealarm.cpp
incidenceattachment.cpp
incidenceattendee.cpp
incidencecategories.cpp
incidencecompletionpriority.cpp
incidencedescription.cpp
incidencewhatwhere.cpp
incidencedatetime.cpp
incidencerecurrence.cpp
incidenceresource.cpp
incidencesecrecy.cpp
freebusyganttproxymodel.cpp
conflictresolver.cpp
schedulingdialog.cpp
groupwareuidelegate.cpp
incidencedefaults.cpp
editorconfig.cpp
korganizereditorconfig.cpp
autochecktreewidget.cpp
categoryeditdialog.cpp
categoryselectdialog.cpp
categorydialog.cpp
# Individual mail
individualmailcomponentfactory.cpp
individualmaildialog.cpp
opencomposerjob.cpp
# Resourcemanagement
ldaputils.cpp
resourcemanagement.cpp
resourceitem.cpp
resourcemodel.cpp
)
ecm_qt_declare_logging_category(incidenceeditors_ng_shared_LIB_SRCS HEADER incidenceeditor_debug.h IDENTIFIER INCIDENCEEDITOR_LOG CATEGORY_NAME log_incidenceeditor)
kconfig_add_kcfg_files(incidenceeditors_ng_shared_LIB_SRCS globalsettings_incidenceeditor.kcfgc)
### Build the desktop version
set(incidenceeditors_ng_desktop_LIB_SRCS
${incidenceeditors_ng_shared_LIB_SRCS}
templatemanagementdialog.cpp
incidencedialogfactory.cpp
incidencedialog.cpp
visualfreebusywidget.cpp
)
ki18n_wrap_ui(incidenceeditors_ng_desktop_LIB_SRCS
ui/categoryeditdialog_base.ui
ui/categoryselectdialog_base.ui
ui/categorydialog_base.ui
ui/template_management_dialog_base.ui
ui/dialogdesktop.ui
ui/alarmdialog.ui
ui/attachmenteditdialog.ui
ui/schedulingdialog.ui
ui/resourcemanagement.ui
)
add_library(KF5IncidenceEditorsng ${incidenceeditors_ng_desktop_LIB_SRCS})
generate_export_header(KF5IncidenceEditorsng BASE_NAME incidenceeditors_ng)
add_library(KF5::IncidenceEditorsng ALIAS KF5IncidenceEditorsng)
target_link_libraries(KF5IncidenceEditorsng
PUBLIC
KF5::AkonadiCalendar
KF5::AkonadiMime
KF5::CalendarCore
KF5::CalendarUtils
KF5::MailTransport
KF5::CalendarSupport # For KCalPrefs
eventviews
kdgantt2 # For FreeBusy Editor
PRIVATE
KF5::Libkdepim
kdepimdbusinterfaces # For UriHandler
KF5::Codecs
KF5::Ldap
KF5::AkonadiWidgets
)
target_include_directories(KF5IncidenceEditorsng INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/IncidenceEditorsng/;${KDE_INSTALL_INCLUDEDIR_KF5}/incidenceeditorng>")
target_include_directories(KF5IncidenceEditorsng PUBLIC "$<BUILD_INTERFACE:${incidenceeditorsng_SOURCE_DIR}/src;${incidenceeditorsng_BINARY_DIR}/src;>")
set_target_properties(KF5IncidenceEditorsng PROPERTIES
VERSION ${INCIDENCEEDITORSNG_VERSION_STRING}
SOVERSION ${INCIDENCEEDITORSNG_SOVERSION}
EXPORT_NAME IncidenceEditorsng
)
install(TARGETS
KF5IncidenceEditorsng
EXPORT KF5IncidenceEditorsngTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
)
ecm_generate_headers(IncidenceEditorsng_CamelCase_HEADERS
HEADER_NAMES
IncidenceDialog
IncidenceDialogFactory
IncidenceEditorSettings
CategoryEditDialog
IncidenceAttendee
IncidenceDefaults
IndividualMailComponentFactory
GroupwareUiDelegate
REQUIRED_HEADERS IncidenceEditorsng_HEADERS
PREFIX IncidenceEditorsng
)
if(${CMAKE_SOURCE_DIR} STREQUAL ${incidenceeditorsng_SOURCE_DIR})
install(FILES
${IncidenceEditorsng_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/IncidenceEditorsng
COMPONENT Devel
)
install(FILES
${IncidenceEditorsng_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/incidenceeditorsng_export.h
${IncidenceEditorsng_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/incidenceeditorsng
COMPONENT Devel
)
endif()
######
set(testincidenceeditor_SRCS main.cpp)
add_executable(kincidenceeditor ${testincidenceeditor_SRCS})
target_link_libraries(kincidenceeditor
KF5::AkonadiCalendar
KF5::AkonadiCore
KF5::CalendarCore
KF5::CalendarUtils
KF5::IncidenceEditorsng
KF5::CalendarSupport
kdepimdbusinterfaces
)
install(TARGETS kincidenceeditor ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -37,7 +37,7 @@
#include "templatemanagementdialog.h"
#include "ui_dialogdesktop.h"
#include <incidenceeditor-ng/incidenceeditorsettings.h>
#include <incidenceeditorsettings.h>
#include <CalendarSupport/KCalPrefs>
#include <CalendarSupport/Utils>
......