beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / CMakeLists.txt
blobd30fa4b1c7387e0d6793572576cd699dc0b49c6b
1 project(poppler)
3 cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
5 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
7 include(PopplerDefaults)
8 include(PopplerMacros)
9 include(MacroOptionalFindPackage)
10 find_package(PkgConfig)
11 include(MacroEnsureVersion)
12 include(MacroBoolTo01)
13 find_package(Threads)
14 include(TestBigEndian)
15 test_big_endian(WORDS_BIGENDIAN)
16 include(CheckFileOffsetBits)
17 CHECK_FILE_OFFSET_BITS()
19 find_package (ECM 1.6.0 QUIET NO_MODULE)
20 if (ECM_FOUND)
21     include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake")
22 endif()
24 set(POPPLER_MAJOR_VERSION "0")
25 set(POPPLER_MINOR_VERSION "41")
26 set(POPPLER_MICRO_VERSION "0")
27 set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}")
29 # command line switches
30 option(ENABLE_XPDF_HEADERS "Install unsupported xpdf headers." OFF)
31 option(BUILD_GTK_TESTS "Whether compile the GTK+ test programs." ON)
32 option(BUILD_QT4_TESTS "Whether compile the Qt4 test programs." ON)
33 option(BUILD_QT5_TESTS "Whether compile the Qt5 test programs." ON)
34 option(BUILD_CPP_TESTS "Whether compile the CPP test programs." ON)
35 option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
36 option(ENABLE_UTILS "Compile poppler command line utils." ON)
37 option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
38 set(ENABLE_LIBOPENJPEG "auto" CACHE STRING "Use libopenjpeg for JPX streams. Possible values: auto, openjpeg1, openjpeg2. 'auto' prefers openjpeg1 over openjpeg2 if both are available. Unset to not use openjpeg.")
39 set(ENABLE_CMS "auto" CACHE STRING "Use color management system. Possible values: auto, lcms1, lcms2. 'auto' prefers lcms2 over lcms1 if both are available. Unset to disable color management system.")
40 option(ENABLE_LIBCURL "Build libcurl based HTTP support." OFF)
41 option(ENABLE_ZLIB "Build with zlib (not totally safe)." OFF)
42 option(SPLASH_CMYK "Include support for CMYK rasterization." OFF)
43 option(USE_FIXEDPOINT "Use fixed point arithmetic in the Splash backend" OFF)
44 option(USE_FLOAT "Use single precision arithmetic in the Splash backend" OFF)
45 if(WIN32)
46   option(ENABLE_RELOCATABLE "Do not hardcode the poppler library location (on Windows)." ON)
47 else(WIN32)
48   set(ENABLE_RELOCATABLE OFF)
49 endif(WIN32)
51 set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
52 set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Share directory name")
54 set(TESTDATADIR "${CMAKE_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.")
55 if(NOT (EXISTS ${TESTDATADIR} AND EXISTS ${TESTDATADIR}/test-poppler.c))
56   message(WARNING "
57  No test data found in $testdatadir.
58  You will not be able to run 'make test' successfully.
60  The test data is not included in the source packages
61  and is also not part of the main git repository. Instead,
62  you can checkout the test data from its own git
63  repository with:
65    git clone git://git.freedesktop.org/git/poppler/test
67  You should checkout the test data as a sibling of your
68  poppler source folder or specify the location of your
69  checkout with -DTESTDATADIR=/path/to/checkoutdir/test.
70   ")
71 endif()
73 if(WIN32)
74   set(_default_fontconfiguration "win32")
75 else(WIN32)
76   set(_default_fontconfiguration "fontconfig")
77 endif(WIN32)
78 set(FONT_CONFIGURATION "${_default_fontconfiguration}" CACHE STRING "The font configuration backend (win32|fontconfig).")
79 string(TOLOWER "${FONT_CONFIGURATION}" font_configuration)
80 set(WITH_FONTCONFIGURATION_WIN32 OFF)
81 set(WITH_FONTCONFIGURATION_FONTCONFIG OFF)
82 if(font_configuration STREQUAL "win32")
83   set(WITH_FONTCONFIGURATION_WIN32 ON)
84 elseif(font_configuration STREQUAL "fontconfig")
85   set(WITH_FONTCONFIGURATION_FONTCONFIG ON)
86 else(font_configuration STREQUAL "win32")
87   message(FATAL_ERROR "Invalid font configuration setting: ${FONT_CONFIGURATION}")
88 endif(font_configuration STREQUAL "win32")
90 # Enable these unconditionally.
91 set(MULTITHREADED ON)
92 set(OPI_SUPPORT ON)
93 set(TEXTOUT_WORD_LIST ON)
95 # setting the minimum required versions for some components
96 set(QT4_MIN_VERSION "4.7.0")
97 set(CAIRO_VERSION "1.10.0")
98 set(GLIB_REQUIRED "2.18")
100 macro_bool_to_01(ENABLE_SPLASH HAVE_SPLASH)
101 find_package(Freetype REQUIRED)
102 if(WITH_FONTCONFIGURATION_FONTCONFIG)
103   find_package(Fontconfig REQUIRED)
104 endif(WITH_FONTCONFIGURATION_FONTCONFIG)
105 macro_optional_find_package(JPEG)
106 macro_optional_find_package(PNG)
107 macro_optional_find_package(TIFF)
108 if(JPEG_FOUND)
109   set(ENABLE_LIBJPEG ${JPEG_FOUND})
110 endif(JPEG_FOUND)
111 macro_optional_find_package(Qt4)
112 if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
113   find_package(Qt5Core)
114   find_package(Qt5Gui)
115   find_package(Qt5Xml)
116   find_package(Qt5Widgets)
117   find_package(Qt5Test)
118   if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
119     set(QT5_FOUND true)
120   else ()
121     message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
122     set(QT5_FOUND false)
123   endif()
124 else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
125   set(QT5_FOUND false)
126   message("-- CMake >= 2.8.8 is needed to enable Qt5")
127 endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
129 macro_optional_find_package(Cairo ${CAIRO_VERSION})
130 if(CAIRO_FOUND)
131   set(HAVE_CAIRO ${CAIRO_FOUND})
132   set(CAIRO_FEATURE "#define POPPLER_HAS_CAIRO 1")
133   set(CAIRO_REQ "cairo")
134   set(POPPLER_GLIB_DISABLE_DEPRECATED "")
135   set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "")
136   macro_optional_find_package(GLIB)
137   if(GLIB_FOUND)
138     set(ENABLE_GLIB ON)
139     # Check for introspection
140     macro_optional_find_package(GObjectIntrospection 0.9.12)
141     set(HAVE_INTROSPECTION ${INTROSPECTION_FOUND})
142     set(POPPLER_GLIB_DISABLE_DEPRECATED "${POPPLER_GLIB_DISABLE_DEPRECATED} -DG_DISABLE_DEPRECATED")
143     set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "${POPPLER_GLIB_DISABLE_SINGLE_INCLUDES} -DG_DISABLE_SINGLE_INCLUDES")
144     macro_optional_find_package(GTK)
145   endif(GLIB_FOUND)
146 else(CAIRO_FOUND)
147   set(CAIRO_FEATURE "#undef POPPLER_HAS_CAIRO")
148 endif(CAIRO_FOUND)
149 if(ENABLE_CPP)
150   macro_optional_find_package(Iconv)
151   set(ENABLE_CPP ${ICONV_FOUND})
152   set(HAVE_ICONV ${ICONV_FOUND})
153 endif(ENABLE_CPP)
154 if(ENABLE_ZLIB)
155   find_package(ZLIB)
156   if(ZLIB_FOUND)
157     set(HAVE_LIBZ ${ZLIB_FOUND})
158   endif(ZLIB_FOUND)
159   set(ENABLE_ZLIB ${ZLIB_FOUND})
160 endif(ENABLE_ZLIB)
161 set(USE_OPENJPEG1 FALSE)
162 set(USE_OPENJPEG2 FALSE)
163 set(WITH_OPENJPEG FALSE)
164 if(ENABLE_LIBOPENJPEG STREQUAL "auto")
165   find_package(LIBOPENJPEG)
166   set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
167   set(WITH_OPENJPEG ${LIBOPENJPEG_FOUND})
168   if(NOT LIBOPENJPEG_FOUND)
169     find_package(LIBOPENJPEG2)
170     set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
171     set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
172   endif()
173 elseif(ENABLE_LIBOPENJPEG STREQUAL "openjpeg1")
174   find_package(LIBOPENJPEG)
175   set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
176   set(WITH_OPENJPEG ${LIBOPENJPEG_FOUND})
177 elseif(ENABLE_LIBOPENJPEG STREQUAL "openjpeg2")
178   find_package(LIBOPENJPEG2)
179   set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
180   set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
181 endif()
182 set(ENABLE_LIBOPENJPEG "${WITH_OPENJPEG}")
183 if(ENABLE_CMS STREQUAL "auto")
184   find_package(LCMS2)
185   set(USE_CMS ${LCMS2_FOUND})
186   if(NOT LCMS2_FOUND)
187     find_package(LCMS)
188     set(USE_CMS ${LCMS_FOUND})
189     set(USE_LCMS1 ${LCMS_FOUND})
190   endif(NOT LCMS2_FOUND)
191 elseif(ENABLE_CMS STREQUAL "lcms1")
192   find_package(LCMS)
193   set(USE_CMS ${LCMS_FOUND})
194   set(USE_LCMS1 ${LCMS_FOUND})
195 elseif(ENABLE_CMS STREQUAL "lcms2")
196   find_package(LCMS2)
197   set(USE_CMS ${LCMS2_FOUND})
198 endif()
199 if(ENABLE_LIBCURL)
200   find_package(CURL)
201   include_directories(${CURL_INCLUDE_DIR})
202   set(POPPLER_HAS_CURL_SUPPORT ON)
203 endif(ENABLE_LIBCURL)
205 add_definitions(-DHAVE_CONFIG_H=1)
206 if(MINGW)
207   # Use mingw's ansi stdio extensions
208   add_definitions(-D__USE_MINGW_ANSI_STDIO=1)
209 endif(MINGW)
210 if(FONTCONFIG_FOUND)
211   add_definitions(${FONTCONFIG_DEFINITIONS})
212   include_directories(${FONTCONFIG_INCLUDE_DIR})
213 endif(FONTCONFIG_FOUND)
214 if(WITH_FONTCONFIGURATION_WIN32)
215   if(MINGW)
216     # Set the minimum required Internet Explorer version to 5.0
217     add_definitions(-D_WIN32_IE=0x0500)
218   endif(MINGW)
219 endif(WITH_FONTCONFIGURATION_WIN32)
220 include_directories(
221   ${CMAKE_CURRENT_SOURCE_DIR}
222   ${CMAKE_CURRENT_SOURCE_DIR}/fofi
223   ${CMAKE_CURRENT_SOURCE_DIR}/goo
224   ${CMAKE_CURRENT_SOURCE_DIR}/poppler
225   ${CMAKE_CURRENT_BINARY_DIR}
226   ${CMAKE_CURRENT_BINARY_DIR}/poppler
227   ${FREETYPE_INCLUDE_DIRS}
229 set(HAVE_FREETYPE_H ON)
230 if(CMAKE_USE_PTHREADS_INIT)
231   set(HAVE_PTHREAD ON)
232 endif(CMAKE_USE_PTHREADS_INIT)
234 if(ENABLE_ZLIB)
235   include_directories(${ZLIB_INCLUDE_DIR})
236 endif(ENABLE_ZLIB)
237 if(JPEG_FOUND)
238   include_directories(${JPEG_INCLUDE_DIR})
239   set(ENABLE_LIBJPEG ON)
240 endif(JPEG_FOUND)
241 if(PNG_FOUND)
242   include_directories(${PNG_INCLUDE_DIR})
243   set(ENABLE_LIBPNG ON)
244 endif(PNG_FOUND)
245 if(TIFF_FOUND)
246   include_directories(${TIFF_INCLUDE_DIR})
247   set(ENABLE_LIBTIFF ON)
248 endif(TIFF_FOUND)
249 if(LIBOPENJPEG_FOUND)
250   include_directories(${LIBOPENJPEG_INCLUDE_DIR})
251 endif(LIBOPENJPEG_FOUND)
252 if(LIBOPENJPEG2_FOUND)
253   include_directories(${LIBOPENJPEG2_INCLUDE_DIRS})
254 endif()
255 if(LCMS_FOUND)
256   include_directories(${LCMS_INCLUDE_DIR})
257 endif(LCMS_FOUND)
258 if(LCMS2_FOUND)
259   include_directories(${LCMS2_INCLUDE_DIR})
260 endif(LCMS2_FOUND)
262 # Recent versions of poppler-data install a .pc file.
263 # Use it to determine the encoding data path, if available.
264 # Default to the same prefix otherwise.
265 pkg_check_modules(POPPLER_DATA poppler-data)
266 if(POPPLER_DATA_FOUND)
267   execute_process(COMMAND "${PKG_CONFIG_EXECUTABLE}" --variable=poppler_datadir poppler-data
268                   RESULT_VARIABLE _result_var
269                   OUTPUT_VARIABLE _output_var OUTPUT_STRIP_TRAILING_WHITESPACE)
270   if(_result_var STREQUAL "0" AND NOT _output_var STREQUAL "")
271     set(POPPLER_DATADIR "${_output_var}")
272   endif(_result_var STREQUAL "0" AND NOT _output_var STREQUAL "")
273 endif(POPPLER_DATA_FOUND)
274 if(NOT DEFINED POPPLER_DATADIR)
275   set(POPPLER_DATADIR "${CMAKE_INSTALL_PREFIX}/share/poppler")
276 endif(NOT DEFINED POPPLER_DATADIR)
278 if(DEFINED COMPILE_WARNINGS)
279 else(DEFINED COMPILE_WARNINGS)
280   set(COMPILE_WARNINGS "yes")
281 endif(DEFINED COMPILE_WARNINGS)
282 string(TOLOWER "${COMPILE_WARNINGS}" _comp_warnings)
283 if(_comp_warnings STREQUAL "no")
284   set(CMAKE_CXX_FLAGS "${DEFAULT_COMPILE_WARNINGS_NO} ${CMAKE_CXX_FLAGS}")
285 endif(_comp_warnings STREQUAL "no")
286 if(_comp_warnings STREQUAL "yes")
287   set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
288   set(CMAKE_CXX_FLAGS "${DEFAULT_COMPILE_WARNINGS_YES} ${CMAKE_CXX_FLAGS}")
289 endif(_comp_warnings STREQUAL "yes")
290 if(_comp_warnings STREQUAL "kde")
291   set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
292   set(CMAKE_CXX_FLAGS "${DEFAULT_COMPILE_WARNINGS_KDE} ${CMAKE_CXX_FLAGS}")
293 endif(_comp_warnings STREQUAL "kde")
296 include(ConfigureChecks.cmake)
297 configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
298 configure_file(poppler/poppler-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h)
301 set(poppler_SRCS
302   goo/gfile.cc
303   goo/gmempp.cc
304   goo/GooHash.cc
305   goo/GooList.cc
306   goo/GooTimer.cc
307   goo/GooString.cc
308   goo/gmem.cc
309   goo/FixedPoint.cc
310   goo/NetPBMWriter.cc
311   goo/PNGWriter.cc
312   goo/TiffWriter.cc
313   goo/JpegWriter.cc
314   goo/ImgWriter.cc
315   goo/gstrtod.cc
316   goo/grandom.cc
317   fofi/FoFiBase.cc
318   fofi/FoFiEncodings.cc
319   fofi/FoFiTrueType.cc
320   fofi/FoFiType1.cc
321   fofi/FoFiType1C.cc
322   fofi/FoFiIdentifier.cc
323   poppler/Annot.cc
324   poppler/Array.cc
325   poppler/BuiltinFont.cc
326   poppler/BuiltinFontTables.cc
327   poppler/CachedFile.cc
328   poppler/Catalog.cc
329   poppler/CharCodeToUnicode.cc
330   poppler/CMap.cc
331   poppler/DateInfo.cc
332   poppler/Decrypt.cc
333   poppler/Dict.cc
334   poppler/Error.cc
335   poppler/FileSpec.cc
336   poppler/FontEncodingTables.cc
337   poppler/Form.cc
338   poppler/FontInfo.cc
339   poppler/Function.cc
340   poppler/Gfx.cc
341   poppler/GfxFont.cc
342   poppler/GfxState.cc
343   poppler/GlobalParams.cc
344   poppler/Hints.cc
345   poppler/JArithmeticDecoder.cc
346   poppler/JBIG2Stream.cc
347   poppler/Lexer.cc
348   poppler/Link.cc
349   poppler/Linearization.cc
350   poppler/LocalPDFDocBuilder.cc
351   poppler/MarkedContentOutputDev.cc
352   poppler/NameToCharCode.cc
353   poppler/Object.cc
354   poppler/OptionalContent.cc
355   poppler/Outline.cc
356   poppler/OutputDev.cc
357   poppler/Page.cc
358   poppler/PageTransition.cc
359   poppler/Parser.cc
360   poppler/PDFDoc.cc
361   poppler/PDFDocEncoding.cc
362   poppler/PDFDocFactory.cc
363   poppler/PopplerCache.cc
364   poppler/ProfileData.cc
365   poppler/PreScanOutputDev.cc
366   poppler/PSTokenizer.cc
367   poppler/Stream.cc
368   poppler/StructTreeRoot.cc
369   poppler/StructElement.cc
370   poppler/strtok_r.cpp
371   poppler/UnicodeMap.cc
372   poppler/UnicodeTypeTable.cc
373   poppler/UTF.cc
374   poppler/XRef.cc
375   poppler/PSOutputDev.cc
376   poppler/TextOutputDev.cc
377   poppler/PageLabelInfo.cc
378   poppler/SecurityHandler.cc
379   poppler/StdinCachedFile.cc
380   poppler/StdinPDFDocBuilder.cc
381   poppler/Sound.cc
382   poppler/ViewerPreferences.cc
383   poppler/XpdfPluginAPI.cc
384   poppler/Movie.cc
385   poppler/Rendition.cc
387 set(poppler_LIBS ${FREETYPE_LIBRARIES})
388 if(ENABLE_SPLASH)
389   set(poppler_SRCS ${poppler_SRCS}
390     poppler/SplashOutputDev.cc
391     splash/Splash.cc
392     splash/SplashBitmap.cc
393     splash/SplashClip.cc
394     splash/SplashFTFont.cc
395     splash/SplashFTFontEngine.cc
396     splash/SplashFTFontFile.cc
397     splash/SplashFont.cc
398     splash/SplashFontEngine.cc
399     splash/SplashFontFile.cc
400     splash/SplashFontFileID.cc
401     splash/SplashPath.cc
402     splash/SplashPattern.cc
403     splash/SplashScreen.cc
404     splash/SplashState.cc
405     splash/SplashT1Font.cc
406     splash/SplashT1FontEngine.cc
407     splash/SplashT1FontFile.cc
408     splash/SplashXPath.cc
409     splash/SplashXPathScanner.cc
410   )
411 endif(ENABLE_SPLASH)
412 if(FONTCONFIG_FOUND)
413   set(poppler_LIBS ${poppler_LIBS} ${FONTCONFIG_LIBRARIES})
414 endif(FONTCONFIG_FOUND)
415 if(JPEG_FOUND)
416   set(poppler_SRCS ${poppler_SRCS}
417     poppler/DCTStream.cc
418   )
419   set(poppler_LIBS ${poppler_LIBS} ${JPEG_LIBRARIES})
420 endif(JPEG_FOUND)
421 if(ENABLE_ZLIB)
422   set(poppler_SRCS ${poppler_SRCS}
423     poppler/FlateStream.cc
424   )
425   set(poppler_LIBS ${poppler_LIBS} ${ZLIB_LIBRARIES})
426 endif(ENABLE_ZLIB)
427 if(ENABLE_LIBCURL)
428   set(poppler_SRCS ${poppler_SRCS}
429     poppler/CurlCachedFile.cc
430     poppler/CurlPDFDocBuilder.cc
431   )
432   set(poppler_LIBS ${poppler_LIBS} ${CURL_LIBRARIES})
433 endif(ENABLE_LIBCURL)
434 if(LIBOPENJPEG_FOUND)
435   set(poppler_SRCS ${poppler_SRCS}
436     poppler/JPEG2000Stream.cc
437   )
438   set(poppler_LIBS ${poppler_LIBS} ${LIBOPENJPEG_LIBRARIES})
439   add_definitions(-DUSE_OPENJPEG1)
440 elseif (LIBOPENJPEG2_FOUND)
441   set(poppler_SRCS ${poppler_SRCS}
442     poppler/JPEG2000Stream.cc
443   )
444   add_definitions(-DUSE_OPENJPEG2)
445   set(poppler_LIBS ${poppler_LIBS} ${LIBOPENJPEG2_LIBRARIES})
446 else ()
447   set(poppler_SRCS ${poppler_SRCS}
448     poppler/JPXStream.cc
449   )
450 endif()
451 if(USE_CMS)
452   if(LCMS_FOUND)
453     set(poppler_LIBS ${poppler_LIBS} ${LCMS_LIBRARIES})
454   endif(LCMS_FOUND)
455   if(LCMS2_FOUND)
456     set(poppler_LIBS ${poppler_LIBS} ${LCMS2_LIBRARIES})
457   endif(LCMS2_FOUND)
458 endif(USE_CMS)
459 if(WIN32)
460   # gdi32 is needed under win32
461   set(poppler_LIBS ${poppler_LIBS} gdi32)
462 endif(WIN32)
463 if(PNG_FOUND)
464   set(poppler_LIBS ${poppler_LIBS} ${PNG_LIBRARIES})
465 endif(PNG_FOUND)
466 if(TIFF_FOUND)
467   set(poppler_LIBS ${poppler_LIBS} ${TIFF_LIBRARIES})
468 endif(TIFF_FOUND)
469 if(HAVE_PTHREAD)
470   set(poppler_LIBS ${poppler_LIBS} ${CMAKE_THREAD_LIBS_INIT})
471 endif()
473 if(MSVC)
474 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
475 set(CMAKE_CXX_FLAGS "/Zc:wchar_t- ${CMAKE_CXX_FLAGS}")
476 add_library(poppler STATIC ${poppler_SRCS})
477 else(MSVC)
478 add_library(poppler SHARED ${poppler_SRCS})
479 endif(MSVC)
480 set_target_properties(poppler PROPERTIES VERSION 58.0.0 SOVERSION 58)
481 target_link_libraries(poppler LINK_PRIVATE ${poppler_LIBS})
482 install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
484 if(ENABLE_XPDF_HEADERS)
485   install(FILES
486     poppler/Annot.h
487     poppler/Array.h
488     poppler/BuiltinFont.h
489     poppler/BuiltinFontTables.h
490     poppler/CachedFile.h
491     poppler/Catalog.h
492     poppler/CharCodeToUnicode.h
493     poppler/CMap.h
494     poppler/DateInfo.h
495     poppler/Decrypt.h
496     poppler/Dict.h
497     poppler/Error.h
498     poppler/FileSpec.h
499     poppler/FontEncodingTables.h
500     poppler/FontInfo.h
501     poppler/Form.h
502     poppler/Function.cc
503     poppler/Function.h
504     poppler/Gfx.h
505     poppler/GfxFont.h
506     poppler/GfxState.h
507     poppler/GfxState_helpers.h
508     poppler/GlobalParams.h
509     poppler/Hints.h
510     poppler/JArithmeticDecoder.h
511     poppler/JBIG2Stream.h
512     poppler/Lexer.h
513     poppler/Link.h
514     poppler/Linearization.h
515     poppler/LocalPDFDocBuilder.h
516     poppler/MarkedContentOutputDev.h
517     poppler/Movie.h
518     poppler/NameToCharCode.h
519     poppler/Object.h
520     poppler/OptionalContent.h
521     poppler/Outline.h
522     poppler/OutputDev.h
523     poppler/Page.h
524     poppler/PageTransition.h
525     poppler/Parser.h
526     poppler/PDFDoc.h
527     poppler/PDFDocBuilder.h
528     poppler/PDFDocEncoding.h
529     poppler/PDFDocFactory.h
530     poppler/PopplerCache.h
531     poppler/ProfileData.h
532     poppler/PreScanOutputDev.h
533     poppler/PSTokenizer.h
534     poppler/Rendition.h
535     poppler/Stream-CCITT.h
536     poppler/Stream.h
537     poppler/StructElement.h
538     poppler/StructTreeRoot.h
539     poppler/UnicodeMap.h
540     poppler/UnicodeMapTables.h
541     poppler/UnicodeTypeTable.h
542     poppler/UnicodeCClassTables.h
543     poppler/UnicodeCompTables.h
544     poppler/UnicodeDecompTables.h
545     poppler/ViewerPreferences.h
546     poppler/XRef.h
547     poppler/CharTypes.h
548     poppler/CompactFontTables.h
549     poppler/ErrorCodes.h
550     poppler/NameToUnicodeTable.h
551     poppler/PSOutputDev.h
552     poppler/TextOutputDev.h
553     poppler/SecurityHandler.h
554     poppler/StdinCachedFile.h
555     poppler/StdinPDFDocBuilder.h
556     poppler/UTF.h
557     poppler/UTF8.h
558     poppler/XpdfPluginAPI.h
559     poppler/Sound.h
560     ${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h
561     DESTINATION include/poppler)
562   install(FILES
563     goo/GooHash.h
564     goo/GooList.h
565     goo/GooTimer.h
566     goo/GooMutex.h
567     goo/GooString.h
568     goo/gtypes.h
569     goo/gmem.h
570     goo/gfile.h
571     goo/FixedPoint.h
572     goo/ImgWriter.h
573     goo/GooLikely.h
574     goo/gstrtod.h
575     goo/grandom.h
576     DESTINATION include/poppler/goo)
577   if(PNG_FOUND)
578     install(FILES
579       goo/PNGWriter.h
580       DESTINATION include/poppler/goo)
581   endif(PNG_FOUND)
582   if(TIFF_FOUND)
583     install(FILES
584       goo/TiffWriter.h
585       DESTINATION include/poppler/goo)
586   endif(TIFF_FOUND)
587   if(JPEG_FOUND)
588     install(FILES
589       goo/JpegWriter.h
590       DESTINATION include/poppler/goo)
591   endif(JPEG_FOUND)
592   install(FILES
593     fofi/FoFiBase.h
594     fofi/FoFiEncodings.h
595     fofi/FoFiTrueType.h
596     fofi/FoFiType1.h
597     fofi/FoFiType1C.h
598     fofi/FoFiIdentifier.h
599     DESTINATION include/poppler/fofi)
600   if(ENABLE_LIBCURL)
601     install(FILES
602       poppler/CurlCachedFile.h
603       poppler/CurlPDFDocBuilder.h
604       DESTINATION include/poppler)
605   endif(ENABLE_LIBCURL)
606   if(LIBOPENJPEG_FOUND)
607     install(FILES
608       poppler/JPEG2000Stream.h
609       DESTINATION include/poppler)
610   elseif(LIBOPENJPEG2_FOUND)
611     install(FILES
612       poppler/JPEG2000Stream.h
613       DESTINATION include/poppler)
614   else()
615     install(FILES
616       poppler/JPXStream.h
617       DESTINATION include/poppler)
618   endif()
619   if(ENABLE_SPLASH)
620     install(FILES
621       poppler/SplashOutputDev.h
622       DESTINATION include/poppler)
623     install(FILES
624       splash/Splash.h
625       splash/SplashBitmap.h
626       splash/SplashClip.h
627       splash/SplashErrorCodes.h
628       splash/SplashFTFont.h
629       splash/SplashFTFontEngine.h
630       splash/SplashFTFontFile.h
631       splash/SplashFont.h
632       splash/SplashFontEngine.h
633       splash/SplashFontFile.h
634       splash/SplashFontFileID.h
635       splash/SplashGlyphBitmap.h
636       splash/SplashMath.h
637       splash/SplashPath.h
638       splash/SplashPattern.h
639       splash/SplashScreen.h
640       splash/SplashState.h
641       splash/SplashT1Font.h
642       splash/SplashT1FontEngine.h
643       splash/SplashT1FontFile.h
644       splash/SplashTypes.h
645       splash/SplashXPath.h
646       splash/SplashXPathScanner.h
647       DESTINATION include/poppler/splash)
648   endif(ENABLE_SPLASH)
649 endif(ENABLE_XPDF_HEADERS)
652 if(ENABLE_UTILS)
653   add_subdirectory(utils)
654 endif(ENABLE_UTILS)
655 if(ENABLE_GLIB)
656   add_subdirectory(glib)
657 endif(ENABLE_GLIB)
658 add_subdirectory(test)
659 if(QT4_FOUND)
660   add_subdirectory(qt4)
661 endif(QT4_FOUND)
662 if(QT5_FOUND)
663   add_subdirectory(qt5)
664 endif(QT5_FOUND)
665 if(ENABLE_CPP)
666   add_subdirectory(cpp)
667 endif(ENABLE_CPP)
669 set(PKG_CONFIG_VERSION_0_18 TRUE)
670 if(PKG_CONFIG_EXECUTABLE)
671   exec_program(${PKG_CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _output_VAR)
672   macro_ensure_version("0.18" "${_output_VAR}" PKG_CONFIG_VERSION_0_18)
673 endif(PKG_CONFIG_EXECUTABLE)
674 if(PKG_CONFIG_VERSION_0_18)
675   set(PC_REQUIRES "")
676   set(PC_REQUIRES_PRIVATE "Requires.private: poppler = ${POPPLER_VERSION}")
677 else(PKG_CONFIG_VERSION_0_18)
678   set(PC_REQUIRES "poppler = ${POPPLER_VERSION}")
679   set(PC_REQUIRES_PRIVATE "")
680 endif(PKG_CONFIG_VERSION_0_18)
682 poppler_create_install_pkgconfig(poppler.pc lib${LIB_SUFFIX}/pkgconfig)
683 if(ENABLE_SPLASH)
684   poppler_create_install_pkgconfig(poppler-splash.pc lib${LIB_SUFFIX}/pkgconfig)
685 endif(ENABLE_SPLASH)
686 if(QT4_FOUND)
687   poppler_create_install_pkgconfig(poppler-qt4.pc lib${LIB_SUFFIX}/pkgconfig)
688 endif(QT4_FOUND)
689 if(QT5_FOUND)
690   poppler_create_install_pkgconfig(poppler-qt5.pc lib${LIB_SUFFIX}/pkgconfig)
691 endif(QT5_FOUND)
692 if(ENABLE_GLIB)
693   poppler_create_install_pkgconfig(poppler-glib.pc lib${LIB_SUFFIX}/pkgconfig)
694 endif(ENABLE_GLIB)
695 if(CAIRO_FOUND)
696   poppler_create_install_pkgconfig(poppler-cairo.pc lib${LIB_SUFFIX}/pkgconfig)
697 endif(CAIRO_FOUND)
698 if(ENABLE_CPP)
699   poppler_create_install_pkgconfig(poppler-cpp.pc lib${LIB_SUFFIX}/pkgconfig)
700 endif(ENABLE_CPP)
703 message("Building Poppler with support for:")
704 show_end_message("font configuration" ${font_configuration})
705 show_end_message_yesno("splash output" ENABLE_SPLASH)
706 if(SPLASH_CMYK)
707   message("      with CMYK support")
708 endif()
709 show_end_message_yesno("cairo output" CAIRO_FOUND)
710 show_end_message_yesno("qt4 wrapper" QT4_FOUND)
711 show_end_message_yesno("qt5 wrapper" QT5_FOUND)
712 show_end_message_yesno("glib wrapper" ENABLE_GLIB)
713 show_end_message_yesno("  introspection" INTROSPECTION_FOUND)
714 show_end_message_yesno("cpp wrapper" ENABLE_CPP)
715 show_end_message("use gtk-doc" "not supported with this CMake build system")
716 show_end_message_yesno("use libjpeg" ENABLE_LIBJPEG)
717 show_end_message_yesno("use libpng" ENABLE_LIBPNG)
718 show_end_message_yesno("use libtiff" ENABLE_LIBTIFF)
719 show_end_message_yesno("use zlib" ENABLE_ZLIB)
720 show_end_message_yesno("use curl" ENABLE_LIBCURL)
721 show_end_message_yesno("use libopenjpeg" WITH_OPENJPEG)
722 if(USE_OPENJPEG1)
723   message("      with openjpeg1")
724 endif()
725 if(USE_OPENJPEG2)
726   message("      with openjpeg2")
727 endif()
728 show_end_message_yesno("use cms" USE_CMS)
729 if(LCMS_FOUND)
730   message("      with lcms1")
731 endif(LCMS_FOUND)
732 if(LCMS2_FOUND)
733   message("      with lcms2")
734 endif(LCMS2_FOUND)
735 show_end_message_yesno("command line utils" ENABLE_UTILS)
736 show_end_message("test data dir" ${TESTDATADIR})
738 if(NOT ENABLE_SPLASH AND NOT CAIRO_FOUND)
739   message("Warning: There is no rendering backend enabled")
740 endif(NOT ENABLE_SPLASH AND NOT CAIRO_FOUND)
742 if(USE_FIXEDPOINT AND USE_FLOAT)
743   message("Warning: Single precision and fixed point options should not be enabled at the same time")
744 endif(USE_FIXEDPOINT AND USE_FLOAT)
746 if(NOT ENABLE_LIBJPEG)
747   message("Warning: Using libjpeg is recommended. The internal DCT decoder is unmaintained.")
748 endif(NOT ENABLE_LIBJPEG)
750 if(ENABLE_ZLIB)
751   message("Warning: Using zlib is not totally safe")
752 endif(ENABLE_ZLIB)
754 if(NOT WITH_OPENJPEG)
755   message("Warning: Using libopenjpeg is recommended. The internal JPX decoder is unmaintained.")
756 endif(NOT WITH_OPENJPEG)