CMakeLists.txt 7.45 KB
Newer Older
Albert Astals Cid's avatar
Albert Astals Cid committed
1
project(okular)
2

3
cmake_minimum_required(VERSION 2.8.12)
Frederik Gladhorn's avatar
Frederik Gladhorn committed
4
5
6

set(QT_MIN_VERSION "5.2.0")

7
find_package(ECM 0.0.14 CONFIG REQUIRED)
Frederik Gladhorn's avatar
Frederik Gladhorn committed
8
9
10
11
12
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})

include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMOptionalAddSubdirectory)
13
14
15
16
17
include(GenerateExportHeader)
include(FeatureSummary)
include(KDEFrameworkCompilerSettings)
include(KDEInstallDirs)
include(KDECMakeSettings)
Vishesh Handa's avatar
Vishesh Handa committed
18
include(ECMAddTests)
19

Frederik Gladhorn's avatar
Frederik Gladhorn committed
20

Frederik Gladhorn's avatar
Frederik Gladhorn committed
21
find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Test Widgets PrintSupport Svg)
22
find_package(KF5 REQUIRED COMPONENTS
Frederik Gladhorn's avatar
Frederik Gladhorn committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    Activities
    Archive
    Bookmarks
    Config
    ConfigWidgets
    CoreAddons
    DBusAddons
    JS
    KDELibs4Support
    KIO
    Parts
    ThreadWeaver
    Wallet
)
find_package(Phonon4Qt5 CONFIG REQUIRED)
38
39
40

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)

Frederik Gladhorn's avatar
Frederik Gladhorn committed
41
42
43
44
45
46
47
# There was no Qt 5 version at the time of porting
#find_package(QImageBlitz)
#set_package_properties("QImageBlitz" PROPERTIES
#        DESCRIPTION "An image effects library"
#        URL "http://sourceforge.net/projects/qimageblitz"
#        TYPE RECOMMENDED
#        PURPOSE "Required to build Okular.")
48

49
find_package(KF5Screen)
Frederik Gladhorn's avatar
Frederik Gladhorn committed
50
51
52
53
54
set_package_properties("LibKScreen" PROPERTIES
        DESCRIPTION "KDE screen management library"
        URL "https://projects.kde.org/projects/kdereview/libkscreen"
        TYPE RECOMMENDED
        PURPOSE "DPI detection support")
55

56
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
Frederik Gladhorn's avatar
Frederik Gladhorn committed
57

58
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PHONON_INCLUDES})
59

60
61
message("TODO: when core compiles add subdirs")
#add_subdirectory( active )
62
63
64
65
add_subdirectory( ui )
add_subdirectory( shell )
add_subdirectory( generators )
add_subdirectory( tests )
Frederik Gladhorn's avatar
Frederik Gladhorn committed
66
67
68

message("TODO: doc build")
# FIXME ecm_optional_add_subdirectory(doc)
69

70
71
include(OkularConfigureChecks.cmake)

Christian Ehrlicher's avatar
Christian Ehrlicher committed
72
73
74
75
76
if(NOT WIN32)
 set(MATH_LIB m)
else(NOT WIN32)
 set(MATH_LIB)
endif(NOT WIN32)
77

78
# okularcore
79

80
set(okularcore_SRCS
Pino Toscano's avatar
Pino Toscano committed
81
   core/action.cpp
82
83
   core/annotations.cpp
   core/area.cpp
84
   core/audioplayer.cpp
85
   core/bookmarkmanager.cpp
86
87
   core/chooseenginedialog.cpp
   core/document.cpp
88
   core/documentcommands.cpp
89
   core/fontinfo.cpp
90
   core/form.cpp
91
   core/generator.cpp
92
   core/generator_p.cpp
93
   core/misc.cpp
94
   core/movie.cpp
95
   core/observer.cpp
96
   core/page.cpp
97
   core/pagecontroller.cpp
98
   core/pagesize.cpp
99
   core/pagetransition.cpp
100
   core/rotationjob.cpp
101
   core/scripter.cpp
102
   core/sound.cpp
103
   core/sourcereference.cpp
104
   core/textdocumentgenerator.cpp
105
   core/textdocumentsettings.cpp
106
   core/textpage.cpp
107
   core/tilesmanager.cpp
108
   core/utils.cpp
109
   core/view.cpp
John Layt's avatar
John Layt committed
110
   core/fileprinter.cpp
111
   core/script/executor_kjs.cpp
112
   core/script/kjs_app.cpp
113
114
115
116
117
118
119
   core/script/kjs_console.cpp
   core/script/kjs_data.cpp
   core/script/kjs_document.cpp
   core/script/kjs_fullscreen.cpp
   core/script/kjs_field.cpp
   core/script/kjs_spell.cpp
   core/script/kjs_util.cpp
120
121
)

122
123
124
125
kde4_add_ui_files(okularcore_SRCS
   conf/textdocumentsettings.ui
)

126
install( FILES
Pino Toscano's avatar
Pino Toscano committed
127
           core/action.h
128
129
130
           core/annotations.h
           core/area.h
           core/document.h
131
           core/fontinfo.h
132
           core/form.h
133
           core/generator.h
134
           core/global.h
135
           core/okular_export.h
136
           core/page.h
137
           core/pagesize.h
138
139
140
           core/pagetransition.h
           core/sound.h
           core/sourcereference.h
141
           core/textdocumentgenerator.h
142
           core/textdocumentsettings.h
143
           core/textpage.h
144
           core/tile.h
145
           core/utils.h
146
           core/version.h
John Layt's avatar
John Layt committed
147
           core/fileprinter.h
148
           core/observer.h
149
           ${CMAKE_CURRENT_BINARY_DIR}/settings_core.h
Laurent Montel's avatar
Laurent Montel committed
150
         DESTINATION ${INCLUDE_INSTALL_DIR}/okular/core COMPONENT Devel)
151
152
153
154
155

install( FILES
           interfaces/configinterface.h
           interfaces/guiinterface.h
           interfaces/printinterface.h
156
           interfaces/saveinterface.h
157
           interfaces/viewerinterface.h
Laurent Montel's avatar
Laurent Montel committed
158
         DESTINATION ${INCLUDE_INSTALL_DIR}/okular/interfaces COMPONENT Devel)
159

Albert Astals Cid's avatar
Albert Astals Cid committed
160
kde4_add_ui_files(okularcore_SRCS
161
   core/chooseenginewidget.ui
162
163
)

164
kconfig_add_kcfg_files(okularcore_SRCS conf/settings_core.kcfgc )
165
166
167

kde4_add_library(okularcore SHARED ${okularcore_SRCS})

168
169
170
171
172
# Special handling for linking okularcore on OSX/Apple
IF(APPLE)
    SET(OKULAR_IOKIT "-framework IOKit" CACHE STRING "Apple IOKit framework")
ENDIF(APPLE)

Frederik Gladhorn's avatar
Frederik Gladhorn committed
173
174
175
176
177
178
179
180
181
182
183
184
target_link_libraries(okularcore
    ${OKULAR_IOKIT}
    KF5::Archive
    KF5::JS
    KF5::JSApi
    KF5::KDELibs4Support
    KF5::KIOCore
    KF5::ThreadWeaver
    KF5::Wallet
    Phonon::phonon4qt5
    ${MATH_LIB}
)
185

186
if(LibKScreen_FOUND)
Frederik Gladhorn's avatar
Frederik Gladhorn committed
187
#    target_link_libraries(okularcore KF5::LibKScreen)
188
189
endif(LibKScreen_FOUND)

Frederik Gladhorn's avatar
Frederik Gladhorn committed
190
set_target_properties(okularcore PROPERTIES VERSION 5.0.0 SOVERSION 5 )
191

192
install(TARGETS okularcore ${INSTALL_TARGETS_DEFAULT_ARGS} )
193

194
install(FILES conf/okular.kcfg DESTINATION ${KCFG_INSTALL_DIR})
195
install(FILES conf/okular_core.kcfg DESTINATION ${KCFG_INSTALL_DIR})
196
197
install(FILES core/okularGenerator.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})

198
199
200
201
# okularpart

set(okularpart_SRCS
   part.cpp
202
   extensions.cpp
203
204
   conf/preferencesdialog.cpp
   conf/dlgaccessibility.cpp
205
   conf/dlgdebug.cpp
206
   conf/dlgeditor.cpp
207
   conf/dlggeneral.cpp
208
   conf/dlgannotations.cpp
209
210
   conf/dlgperformance.cpp
   conf/dlgpresentation.cpp
211
   conf/widgetannottools.cpp
212
   ui/embeddedfilesdialog.cpp
213
   ui/annotwindow.cpp
214
   ui/annotationmodel.cpp
215
   ui/annotationpopup.cpp
216
   ui/annotationpropertiesdialog.cpp
217
   ui/annotationproxymodels.cpp
218
   ui/annotationtools.cpp
Pino Toscano's avatar
Pino Toscano committed
219
   ui/annotationwidgets.cpp
220
   ui/bookmarklist.cpp
221
   ui/fileprinterpreview.cpp
222
   ui/findbar.cpp
223
   ui/formwidgets.cpp
Pino Toscano's avatar
Pino Toscano committed
224
   ui/guiutils.cpp
225
   ui/ktreeviewsearchline.cpp
226
   ui/latexrenderer.cpp
227
   ui/minibar.cpp
228
   ui/pageitemdelegate.cpp
229
   ui/pagepainter.cpp
Albert Astals Cid's avatar
Albert Astals Cid committed
230
   ui/pagesizelabel.cpp
231
232
   ui/pageviewannotator.cpp
   ui/pageview.cpp
Michal Humpula's avatar
Michal Humpula committed
233
   ui/magnifierview.cpp
234
   ui/pageviewutils.cpp
235
   ui/presentationsearchbar.cpp
236
237
   ui/presentationwidget.cpp
   ui/propertiesdialog.cpp
238
   ui/searchlineedit.cpp
239
   ui/searchwidget.cpp
Pino Toscano's avatar
Pino Toscano committed
240
   ui/sidebar.cpp
241
   ui/side_reviews.cpp
242
   ui/snapshottaker.cpp
243
244
   ui/thumbnaillist.cpp
   ui/toc.cpp
245
   ui/tocmodel.cpp
246
   ui/toolaction.cpp
Frederik Gladhorn's avatar
Frederik Gladhorn committed
247
#   ui/tts.cpp
248
   ui/videowidget.cpp
249
)
250

251
252
kde4_add_ui_files(okularpart_SRCS
   conf/dlgaccessibilitybase.ui
253
   conf/dlgeditorbase.ui
254
   conf/dlggeneralbase.ui
255
   conf/dlgannotationsbase.ui
256
257
258
259
   conf/dlgperformancebase.ui
   conf/dlgpresentationbase.ui
)

260
kconfig_add_kcfg_files(okularpart_SRCS conf/settings.kcfgc )
261

Frederik Gladhorn's avatar
Frederik Gladhorn committed
262
263
message("KF5: Enable ui/tts.cpp again")
#qt4_add_dbus_interfaces(okularpart_SRCS ${KDE4_DBUS_INTERFACES_DIR}/org.kde.KSpeech.xml)
264

265
add_library(okularpart MODULE ${okularpart_SRCS})
266

267
target_link_libraries(okularpart okularcore Qt5::Svg KF5::Parts ${MATH_LIB} Phonon::phonon4qt5 KF5::Solid)
268

269
install(TARGETS okularpart DESTINATION ${PLUGIN_INSTALL_DIR})
270
271
272
273


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

274
275
install(FILES okular.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update)

276
install( FILES okular_part.desktop  DESTINATION  ${SERVICES_INSTALL_DIR} )
277
install( FILES part.rc part-viewermode.rc DESTINATION ${DATA_INSTALL_DIR}/okular )
278

279
280
########### cmake files #################

Frederik Gladhorn's avatar
Frederik Gladhorn committed
281
include(WriteBasicConfigVersionFile)
Frederik Gladhorn's avatar
Frederik Gladhorn committed
282
write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/OkularConfigVersion.cmake VERSION 1.0.0 COMPATIBILITY AnyNewerVersion)
283
284
285

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/OkularConfig.cmake
              ${CMAKE_CURRENT_BINARY_DIR}/OkularConfigVersion.cmake
286
        DESTINATION ${LIB_INSTALL_DIR}/cmake/Okular )
287

Frederik Gladhorn's avatar
Frederik Gladhorn committed
288
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
289