CMakeLists.txt 6.25 KB
Newer Older
1
project(lokalize)
Nick Shaforostoff's avatar
FEATURE    
Nick Shaforostoff committed
2

3
4
5
6
7
8
9
10
if(NOT WIN32)
    find_package(HUNSPELL REQUIRED)
else(NOT WIN32)
    find_package(HUNSPELL)
endif(NOT WIN32)

if(HUNSPELL_FOUND)
    add_definitions(-DHAVE_HUNSPELL)
11
    include_directories(
12
	${HUNSPELL_INCLUDE_DIRS}
13
    )
14
endif(HUNSPELL_FOUND)
Nick Shaforostoff's avatar
FEATURE    
Nick Shaforostoff committed
15

16
include_directories(
17
    ${CMAKE_CURRENT_SOURCE_DIR}/prefs
18
    ${CMAKE_CURRENT_SOURCE_DIR}/common
19
    ${CMAKE_CURRENT_SOURCE_DIR}/catalog
20
    ${CMAKE_CURRENT_SOURCE_DIR}/catalog/gettext
Nick Shaforostoff's avatar
Nick Shaforostoff committed
21
    ${CMAKE_CURRENT_SOURCE_DIR}/catalog/xliff
22
    ${CMAKE_CURRENT_SOURCE_DIR}/catalog/ts
23
24
25
    ${CMAKE_CURRENT_SOURCE_DIR}/cataloglistview
    ${CMAKE_CURRENT_SOURCE_DIR}/project
    ${CMAKE_CURRENT_SOURCE_DIR}/glossary
26
    ${CMAKE_CURRENT_SOURCE_DIR}/webquery
27
    ${CMAKE_CURRENT_SOURCE_DIR}/tm
28
    ${CMAKE_CURRENT_SOURCE_DIR}/filesearch
29
    ${CMAKE_CURRENT_SOURCE_DIR}/mergemode
Simon Depiets's avatar
Simon Depiets committed
30
    ${CMAKE_CURRENT_SOURCE_DIR}/languagetool
31
32
33
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
)
34

Simon Depiets's avatar
Simon Depiets committed
35
36
37
configure_file(version.h.cmake
    ${CMAKE_CURRENT_BINARY_DIR}/version.h)

38
set(liblokalize_SRCS
39
    main.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
40
    lokalizemainwindow.cpp
Christoph Feck's avatar
Christoph Feck committed
41
    actionproxy.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
42

43
44
    editortab.cpp
    editortab_findreplace.cpp
45

46
    editorview.cpp
47
    xlifftextedit.cpp
48
    syntaxhighlighter.cpp
49

Nick Shaforostoff's avatar
yay!    
Nick Shaforostoff committed
50
    completionstorage.cpp
51

52
    phaseswindow.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
53
54
    noteeditor.cpp
    msgctxtview.cpp
55

56
57
    binunitsview.cpp

58
59
60
    cataloglistview/cataloglistview.cpp
    cataloglistview/catalogmodel.cpp

61
    common/headerviewmenu.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
62
    common/domroutines.cpp
63
    common/htmlhelpers.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
64
    common/fastsizehintitemdelegate.cpp
65
66
    common/flowlayout.cpp
    common/termlabel.cpp
67
    common/languagelistmodel.cpp
68
    common/stemming.cpp
69
    glossary/glossaryview.cpp
70
    glossary/glossary.cpp
71
    glossary/glossarywindow.cpp
72

73
74
    metadata/filemetadata.cpp

75
76
    mergemode/mergecatalog.cpp
    mergemode/mergeview.cpp
77
    alttransview.cpp
78
    common/diff.cpp
79
80
    project/project.cpp
    project/projectmodel.cpp
81
    project/projectwidget.cpp
82
    project/projecttab.cpp
83
    project/updatestatsjob.cpp
84
85
    metadata/poextractor.cpp
    metadata/xliffextractor.cpp
86

87
    prefs/prefs.cpp
88

89
90
91
    webquery/webqueryview.cpp
    webquery/webquerycontroller.cpp
    webquery/myactioncollectionview.cpp
Simon Depiets's avatar
Simon Depiets committed
92
93
94
95
96
97

    languagetool/languagetoolresultjob.cpp
    languagetool/languagetoolmanager.cpp
    languagetool/languagetoolparser.cpp
    languagetool/languagetoolgrammarerror.cpp

98
    tools/widgettextcaptureconfig.cpp
99

100
101
    filesearch/filesearchtab.cpp

102
    tm/tmview.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
103
    tm/tmscanapi.cpp
104
    tm/jobs.cpp
105
    tm/dbfilesmodel.cpp
106
    tm/tmmanager.cpp
107
    tm/tmtab.cpp
108
109
    tm/qaview.cpp
    tm/qamodel.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
110

111
112
    catalog/phase.cpp

113
    catalog/cmd.cpp
114
    catalog/pos.cpp
115
    catalog/catalog.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
116
    catalog/catalogstring.cpp
117
    catalog/gettextheader.cpp
118
119
120
121
122
    catalog/gettext/gettextstorage.cpp
    catalog/gettext/catalogitem.cpp
    catalog/gettext/importplugin.cpp
    catalog/gettext/gettextimport.cpp
    catalog/gettext/gettextexport.cpp
Nick Shaforostoff's avatar
Nick Shaforostoff committed
123
    catalog/xliff/xliffstorage.cpp
124
    catalog/ts/tsstorage.cpp
125
)
126

127
if(WIN32)
128
    list (APPEND liblokalize_SRCS common/winhelpers.cpp)
129
else(WIN32)
130
    list (APPEND liblokalize_SRCS common/unixhelpers.cpp)
131
132
endif(WIN32)

133
ecm_qt_declare_logging_category(liblokalize_SRCS
Luigi Toscano's avatar
Luigi Toscano committed
134
135
136
137
    HEADER lokalize_debug.h
    IDENTIFIER LOKALIZE_LOG
    CATEGORY_NAME org.kde.lokalize
    DEFAULT_SEVERITY Warning
Laurent Montel's avatar
Laurent Montel committed
138
139
    DESCRIPTION "Lokalize (lokalize)"
    EXPORT LOKALIZE
Luigi Toscano's avatar
Luigi Toscano committed
140
141
)

142
ki18n_wrap_ui(liblokalize_SRCS
143
    prefs/prefs_identity.ui
144
    prefs/prefs_general.ui
Nick Shaforostoff's avatar
Nick Shaforostoff committed
145
146
147
    prefs/prefs_editor.ui
    prefs/prefs_appearance.ui
    prefs/prefs_tm.ui
148
    prefs/prefs_pology.ui
Simon Depiets's avatar
Simon Depiets committed
149
    prefs/prefs_languagetool.ui
150
    project/prefs_project_advanced.ui
151
    project/prefs_project_local.ui
152
    project/prefs_projectmain.ui
153
    glossary/termedit.ui
154
    filesearch/filesearchoptions.ui
155
    filesearch/massreplaceoptions.ui
156
    tm/queryoptions.ui
157
    tm/managedatabases.ui
158
    tm/dbparams.ui
159
    kaider_findextension.ui
160
    webquery/querycontrol.ui
161
    tools/widgettextcaptureconfig.ui
162
)
163

164
kconfig_add_kcfg_files(liblokalize_SRCS
Nick Shaforostoff's avatar
Nick Shaforostoff committed
165
    prefs/prefs_lokalize.kcfgc
166
    project/projectbase.kcfgc
167
    project/projectlocal.kcfgc
168
)
169

170
qt5_add_dbus_adaptor(liblokalize_SRCS org.kde.lokalize.MainWindow.xml
Nick Shaforostoff's avatar
Nick Shaforostoff committed
171
                     lokalizemainwindow.h LokalizeMainWindow)
172
qt5_add_dbus_adaptor(liblokalize_SRCS org.kde.lokalize.Editor.xml
173
                     editortab.h EditorTab)
174
qt5_add_dbus_adaptor(liblokalize_SRCS filesearch/org.kde.lokalize.FileSearch.xml
175
                     filesearch/filesearchtab.h FileSearchTab)
176
qt5_add_dbus_adaptor(liblokalize_SRCS tm/org.kde.lokalize.TranslationMemory.xml
177
                     tm/tmtab.h TM::TMTab)
178
qt5_add_dbus_adaptor(liblokalize_SRCS project/org.kde.lokalize.Project.xml
179
                     project/project.h Project)
180
qt5_add_dbus_adaptor(liblokalize_SRCS project/org.kde.lokalize.ProjectOverview.xml
181
                     project/projecttab.h ProjectTab)
182
183


184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
### Build intermediate library (will be used by unit tests) ###
add_library(liblokalize STATIC ${liblokalize_SRCS})
target_link_libraries(liblokalize
    KF5::KIOFileWidgets
    KF5::ItemViews
    KF5::Notifications
    KF5::SonnetCore
    KF5::SonnetUi
    KF5::KrossCore
    KF5::KrossUi
    KF5::DBusAddons
    KF5::Crash
    Qt5::Sql
)
if(HUNSPELL_FOUND)
    target_link_libraries(liblokalize ${HUNSPELL_LIBRARIES})
endif(HUNSPELL_FOUND)


### Build Lokalize executable ###
set(lokalize_SRCS main.cpp)
Nick Shaforostoff's avatar
Nick Shaforostoff committed
205

206
207
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../icons/global/*-apps-lokalize.png")
ecm_add_app_icon(lokalize_SRCS ICONS ${ICONS_SRCS})
208

209
add_executable(lokalize ${lokalize_SRCS})
210
target_link_libraries(lokalize liblokalize)
211

212
install(TARGETS lokalize ${INSTALL_TARGETS_DEFAULT_ARGS} )
213
214
215
216


########### install files ###############

Laurent Montel's avatar
Laurent Montel committed
217
install( PROGRAMS org.kde.lokalize.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
Nick Shaforostoff's avatar
Nick Shaforostoff committed
218
install( FILES prefs/lokalize.kcfg  DESTINATION  ${KCFG_INSTALL_DIR} )
219
install( FILES lokalize.notifyrc DESTINATION  ${KNOTIFYRC_INSTALL_DIR} )
220

Laurent Montel's avatar
Laurent Montel committed
221
222
223
224
225
226
ecm_qt_install_logging_categories(
        EXPORT LOKALIZE
        FILE lokalize.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )

Nick Shaforostoff's avatar
Nick Shaforostoff committed
227
228
229
230
231
232
233
234
235

install( FILES
        editorui.rc
        lokalizemainwindowui.rc
        scriptsui.rc
        project/projectmanagerui.rc
        tm/translationmemoryrui.rc
        filesearch/filesearchtabui.rc
        DESTINATION  ${KXMLGUI_INSTALL_DIR}/lokalize )
236
237
238
239

if(BUILD_TESTING)
    add_subdirectory(tests)
endif()