OSDN Git Service

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