OSDN Git Service

generic: generate export headers
[kde/kde-extraapps.git] / okular / CMakeLists.txt
1 project(okular)
2
3 if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
4     find_package(KDE4 4.19.0 REQUIRED)
5     include(KDE4Defaults)
6     include_directories(${KDE4_INCLUDES})
7     add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
8 endif()
9
10 include_directories(
11    ${CMAKE_CURRENT_SOURCE_DIR}
12    ${CMAKE_CURRENT_BINARY_DIR}
13 )
14
15 macro_optional_find_package(PopplerQt4 0.28.0)
16 set_package_properties(PopplerQt4 PROPERTIES
17     DESCRIPTION "A PDF rendering library"
18     URL "http://poppler.freedesktop.org"
19     PURPOSE "Support for PDF files in Okular"
20 )
21
22 macro_optional_find_package(LibSpectre 0.2)
23 set_package_properties(LibSpectre PROPERTIES
24     DESCRIPTION "A PostScript rendering library"
25     URL "http://libspectre.freedesktop.org/wiki/"
26     PURPOSE "Support for PS files in Okular"
27 )
28
29 macro_optional_find_package(DjVuLibre 3.5.17)
30 set_package_properties(DjVuLibre PROPERTIES
31     DESCRIPTION "A library for dealing with DjVu formatted files"
32     URL "http://djvulibre.djvuzone.org"
33     PURPOSE "Support for DjVu files in Okular"
34 )
35
36 macro_optional_find_package(Freetype)
37 set_package_properties(Freetype PROPERTIES
38     DESCRIPTION "A font rendering engine"
39     URL "http://www.freetype.org"
40     PURPOSE "Provides freetype font support in the Okular DVI generator"
41 )
42
43 macro_optional_find_package(JPEG)
44 set_package_properties(JPEG PROPERTIES
45     DESCRIPTION "A library for reading and writing JPEG image files"
46     URL "http://www.ijg.org"
47     PURPOSE "Support fof PalmDB documents in Okular"
48 )
49
50 macro_optional_find_package(ZLIB)
51 set_package_properties(ZLIB PROPERTIES
52     DESCRIPTION "General purpose data compression library"
53     URL "http://www.zlib.net"
54     PURPOSE "Support for Plucker files in Okular"
55 )
56
57 macro_optional_find_package(EPub)
58 set_package_properties(EPub PROPERTIES
59     DESCRIPTION "A library for reading EPub documents"
60     URL "http://sourceforge.net/projects/ebook-tools"
61     PURPOSE "Support for EPub documents in Okular"
62 )
63
64 macro_optional_find_package(QMobipocket)
65 set_package_properties(QMobipocket PROPERTIES
66     DESCRIPTION "A library for reading Mobipocket documents"
67     URL "https://projects.kde.org/projects/kde/kdegraphics/kdegraphics-mobipocket"
68     PURPOSE "Support for Mobipocket documents in Okular"
69 )
70
71 # v1.5.0+ required for gcry_kdf_derive()
72 macro_optional_find_package(LibGcrypt 1.5.0)
73 set_package_properties(LibGcrypt PROPERTIES
74     DESCRIPTION "General purpose cryptographic library based on the code from GnuPG"
75     URL "https://gnupg.org/gcrypt/"
76     PURPOSE "Support encrypted Open Document in Okular"
77 )
78
79 find_program(GHOSTSCRIPT_EXECUTABLE NAMES gs)
80 add_feature_info(okular_gs
81     GHOSTSCRIPT_EXECUTABLE
82     "PostScript support in Okular"
83 )
84
85 add_subdirectory( plasma )
86 add_subdirectory( ui )
87 add_subdirectory( shell )
88 add_subdirectory( generators )
89
90 if(ENABLE_TESTING)
91     add_subdirectory( tests )
92 endif()
93
94 include(OkularConfigureChecks.cmake)
95
96 set(MATH_LIB m)
97
98 # okularcore
99
100 set(okularcore_SRCS
101     core/action.cpp
102     core/annotations.cpp
103     core/area.cpp
104     core/audioplayer.cpp
105     core/bookmarkmanager.cpp
106     core/chooseenginedialog.cpp
107     core/document.cpp
108     core/documentcommands.cpp
109     core/fontinfo.cpp
110     core/form.cpp
111     core/generator.cpp
112     core/generator_p.cpp
113     core/misc.cpp
114     core/movie.cpp
115     core/observer.cpp
116     core/page.cpp
117     core/pagecontroller.cpp
118     core/pagesize.cpp
119     core/pagetransition.cpp
120     core/rotationjob.cpp
121     core/sound.cpp
122     core/sourcereference.cpp
123     core/textdocumentgenerator.cpp
124     core/textdocumentsettings.cpp
125     core/textpage.cpp
126     core/tilesmanager.cpp
127     core/utils.cpp
128     core/view.cpp
129     core/fileprinter.cpp
130     core/chooseenginewidget.ui
131     core/textdocumentsettings.ui
132 )
133
134 install(
135     FILES
136     core/action.h
137     core/annotations.h
138     core/area.h
139     core/document.h
140     core/fontinfo.h
141     core/form.h
142     core/generator.h
143     core/global.h
144     core/page.h
145     core/pagesize.h
146     core/pagetransition.h
147     core/sound.h
148     core/sourcereference.h
149     core/textdocumentgenerator.h
150     core/textdocumentsettings.h
151     core/textpage.h
152     core/tile.h
153     core/utils.h
154     core/version.h
155     core/fileprinter.h
156     core/observer.h
157     ${CMAKE_CURRENT_BINARY_DIR}/settings_core.h
158     ${CMAKE_CURRENT_BINARY_DIR}/okular_export.h
159     DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/okular/core
160     COMPONENT Devel
161 )
162
163 install(
164     FILES
165     interfaces/configinterface.h
166     interfaces/guiinterface.h
167     interfaces/printinterface.h
168     interfaces/saveinterface.h
169     interfaces/viewerinterface.h
170     DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/okular/interfaces
171     COMPONENT Devel
172 )
173
174 kde4_add_kcfg_files(okularcore_SRCS ${PROJECT_SOURCE_DIR}/conf/settings_core.kcfgc )
175
176 add_library(okularcore SHARED ${okularcore_SRCS})
177
178 target_link_libraries(okularcore
179     ${KDE4_KIO_LIBS}
180     ${MATH_LIB}
181     KDE4::kmediaplayer
182 )
183
184 set_target_properties(okularcore PROPERTIES
185     VERSION ${GENERIC_LIB_VERSION}
186     SOVERSION ${GENERIC_LIB_SOVERSION}
187 )
188
189 generate_export_header(okularcore BASE_NAME okular)
190
191 install(TARGETS okularcore ${INSTALL_TARGETS_DEFAULT_ARGS} )
192
193 install(FILES conf/okular.kcfg DESTINATION ${KDE4_KCFG_INSTALL_DIR})
194 install(FILES conf/okular_core.kcfg DESTINATION ${KDE4_KCFG_INSTALL_DIR})
195 install(FILES core/okularGenerator.desktop DESTINATION ${KDE4_SERVICETYPES_INSTALL_DIR})
196
197 # okularpart
198
199 set(okularpart_SRCS
200     part.cpp
201     extensions.cpp
202     conf/preferencesdialog.cpp
203     conf/dlgaccessibility.cpp
204     conf/dlgdebug.cpp
205     conf/dlgeditor.cpp
206     conf/dlggeneral.cpp
207     conf/dlgannotations.cpp
208     conf/dlgperformance.cpp
209     conf/dlgpresentation.cpp
210     conf/widgetannottools.cpp
211     ui/embeddedfilesdialog.cpp
212     ui/annotwindow.cpp
213     ui/annotationmodel.cpp
214     ui/annotationpopup.cpp
215     ui/annotationpropertiesdialog.cpp
216     ui/annotationproxymodels.cpp
217     ui/annotationtools.cpp
218     ui/annotationwidgets.cpp
219     ui/bookmarklist.cpp
220     ui/fileprinterpreview.cpp
221     ui/findbar.cpp
222     ui/formwidgets.cpp
223     ui/guiutils.cpp
224     ui/ktreeviewsearchline.cpp
225     ui/latexrenderer.cpp
226     ui/minibar.cpp
227     ui/pageitemdelegate.cpp
228     ui/pagepainter.cpp
229     ui/pagesizelabel.cpp
230     ui/pageviewannotator.cpp
231     ui/pageview.cpp
232     ui/magnifierview.cpp
233     ui/pageviewutils.cpp
234     ui/presentationsearchbar.cpp
235     ui/presentationwidget.cpp
236     ui/propertiesdialog.cpp
237     ui/searchlineedit.cpp
238     ui/searchwidget.cpp
239     ui/sidebar.cpp
240     ui/side_reviews.cpp
241     ui/snapshottaker.cpp
242     ui/thumbnaillist.cpp
243     ui/toc.cpp
244     ui/tocmodel.cpp
245     ui/toolaction.cpp
246     ui/tts.cpp
247     ui/videowidget.cpp
248     conf/dlgaccessibilitybase.ui
249     conf/dlgeditorbase.ui
250     conf/dlggeneralbase.ui
251     conf/dlgannotationsbase.ui
252     conf/dlgperformancebase.ui
253     conf/dlgpresentationbase.ui
254 )
255
256 kde4_add_kcfg_files(okularpart_SRCS ${PROJECT_SOURCE_DIR}/conf/settings.kcfgc )
257
258 qt4_add_dbus_interfaces(okularpart_SRCS ${KDE4_DBUS_INTERFACES_INSTALL_DIR}/org.kde.KSpeech.xml)
259
260 kde4_add_plugin(okularpart ${okularpart_SRCS})
261
262 target_link_libraries(okularpart
263     ${KDE4_KPARTS_LIBS}
264     ${KDE4_KPRINTUTILS_LIBS}
265     ${MATH_LIB}
266     ${KDE4_SOLID_LIBS}
267     okularcore
268 )
269
270 generate_export_header(okularpart)
271
272 install(TARGETS okularpart DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
273
274
275 ########### install files ###############
276
277 install(FILES okular_part.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
278 install(FILES part.rc part-viewermode.rc DESTINATION ${KDE4_DATA_INSTALL_DIR}/okular)