CMakeLists.txt 4.01 KB
Newer Older
1
2
3
4
5

add_definitions(-DTRANSLATION_DOMAIN=\"libtemplateparser\")


set(templateparser_LIB_SRCS
6
    templateparserjob.cpp
Laurent Montel's avatar
Laurent Montel committed
7
8
9
10
11
    defaulttemplates.cpp
    templatesutil.cpp
    customtemplates.cpp
    customtemplatesmenu.cpp
    templatesconfiguration.cpp
Laurent Montel's avatar
Laurent Montel committed
12
    templatesinsertcommandpushbutton.cpp
Laurent Montel's avatar
Laurent Montel committed
13
    templatescommandmenu.cpp
Laurent Montel's avatar
Laurent Montel committed
14
    templatesinsertcommandaction.cpp
Laurent Montel's avatar
Laurent Montel committed
15
16
    templatestextedit.cpp
    templatestexteditor.cpp
Laurent Montel's avatar
Laurent Montel committed
17
    templateextracttextfrommail.cpp
18
    templatewebenginepage.cpp
Laurent Montel's avatar
Laurent Montel committed
19
    templateextracthtmlelementfrommail.cpp
20
    templateparserextracthtmlinfo.cpp
Laurent Montel's avatar
Laurent Montel committed
21
    templateparserextracthtmlinforesult.cpp
Laurent Montel's avatar
Laurent Montel committed
22
    templateparseremailaddressrequesterbase.cpp
Laurent Montel's avatar
Laurent Montel committed
23
    templateparseremailaddressrequesterlineedit.cpp
Laurent Montel's avatar
Laurent Montel committed
24
    templateparseremailaddressrequesterinterfacewidget.cpp
25
    templateconvertcommandjob.cpp
Laurent Montel's avatar
Laurent Montel committed
26
    )
27
ecm_qt_declare_logging_category(templateparser_LIB_SRCS HEADER templateparser_debug.h IDENTIFIER TEMPLATEPARSER_LOG CATEGORY_NAME org.kde.pim.templateparser
Laurent Montel's avatar
Laurent Montel committed
28
29
30
31
        DESCRIPTION "messagelib (templateparser)"
        OLD_CATEGORY_NAMES log_templateparser
        EXPORT MESSAGELIB
    )
32
33
34
35
36
37



kconfig_add_kcfg_files(templateparser_LIB_SRCS settings/templatesconfiguration_kfg.kcfgc)

kconfig_add_kcfg_files(templateparser_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
38
39
40
    settings/customtemplates_kfg.kcfgc
    settings/globalsettings_templateparser.kcfgc
    )
41
42

ki18n_wrap_ui(templateparser_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
43
44
45
    ui/templatesconfiguration_base.ui
    ui/customtemplates_base.ui
    )
46
47

add_library(KF5TemplateParser ${templateparser_LIB_SRCS})
Laurent Montel's avatar
Laurent Montel committed
48
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
49
50
51
    set_target_properties(KF5TemplateParser PROPERTIES UNITY_BUILD ON)
endif()

52
53
54
55
generate_export_header(KF5TemplateParser BASE_NAME templateparser)
add_library(KF5::TemplateParser ALIAS KF5TemplateParser)

target_link_libraries(KF5TemplateParser
Laurent Montel's avatar
Laurent Montel committed
56
57
    PRIVATE
    KF5::Mime
58
    KF5::MimeTreeParser
Laurent Montel's avatar
Laurent Montel committed
59
60
61
62
    KF5::IdentityManagement
    KF5::MessageCore
    KF5::XmlGui
    KF5::Completion
Laurent Montel's avatar
Laurent Montel committed
63
64
    KF5::I18n
    KF5::SonnetUi
65
    KF5::SyntaxHighlighting
66
    Qt::WebEngineWidgets
67
    KF5::Libkdepim
Laurent Montel's avatar
Laurent Montel committed
68
    )
69
set_target_properties(KF5TemplateParser PROPERTIES
70
    VERSION ${TEMPLATEPARSER_VERSION}
Laurent Montel's avatar
Laurent Montel committed
71
72
73
    SOVERSION ${TEMPLATEPARSER_SOVERSION}
    EXPORT_NAME TemplateParser
    )
74

Laurent Montel's avatar
Laurent Montel committed
75
target_include_directories(KF5TemplateParser INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/TemplateParser/;${KDE_INSTALL_INCLUDEDIR_KF5}/templateparser;${KDE_INSTALL_INCLUDEDIR_KF5}>")
76
77

install(FILES
Laurent Montel's avatar
Laurent Montel committed
78
79
80
81
    settings/customtemplates_kfg.kcfg
    settings/templatesconfiguration_kfg.kcfg
    DESTINATION ${KDE_INSTALL_KCFGDIR}
    )
82
83

ecm_generate_headers(TemplateParser_CamelCase_HEADERS
Laurent Montel's avatar
Laurent Montel committed
84
85
86
87
88
89
90
    HEADER_NAMES
    CustomTemplates
    CustomTemplatesMenu
    DefaultTemplates
    TemplatesConfiguration
    TemplatesTextEdit
    TemplatesUtil
Laurent Montel's avatar
Laurent Montel committed
91
    TemplatesInsertCommandPushButton
Laurent Montel's avatar
Laurent Montel committed
92
    TemplatesCommandMenu
Laurent Montel's avatar
Laurent Montel committed
93
    TemplatesInsertCommandAction
94
    TemplateParserJob
Laurent Montel's avatar
Laurent Montel committed
95
    TemplateParserExtractHtmlInfoResult
Laurent Montel's avatar
Laurent Montel committed
96
    TemplateParserEmailAddressRequesterBase
97
    TemplateConvertCommandJob
Laurent Montel's avatar
Laurent Montel committed
98
99
100
    REQUIRED_HEADERS TemplateParser_HEADERS
    PREFIX TemplateParser
    )
101
102
103

ecm_generate_pri_file(BASE_NAME TemplateParser
    LIB_NAME KF5TemplateParser
104
    DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/TemplateParser
Laurent Montel's avatar
Laurent Montel committed
105
    )
106
107


108
install(TARGETS KF5TemplateParser EXPORT KF5TemplateParserTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
Laurent Montel's avatar
Laurent Montel committed
109

110
111
112
113
114
115


install(FILES
    ${TemplateParser_CamelCase_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/TemplateParser
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
116
    )
117
118
119
120
121
122
123
124
125
126

install(FILES
    ${TemplateParser_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/templateparser_export.h
    ${CMAKE_CURRENT_BINARY_DIR}/globalsettings_templateparser.h
    ${CMAKE_CURRENT_BINARY_DIR}/customtemplates_kfg.h
    ${CMAKE_CURRENT_BINARY_DIR}/ui_templatesconfiguration_base.h
    ${CMAKE_CURRENT_BINARY_DIR}/templatesconfiguration_kfg.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/templateparser
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
127
    )
128
129
130
131
132

install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})

133
install(FILES syntax/kmail-template.xml DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax)