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