sinc with TL rev. 38618.
[luatex.git] / source / libs / poppler / poppler-0.37.0 / CMakeLists.txt
blobff81531a7b643c0504d2387a9b5667ecaa612b17
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 "37")
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 MESSAGE(${LIBOPENJPEG2_LIBRARIES})
446   set(poppler_LIBS ${poppler_LIBS} ${LIBOPENJPEG2_LIBRARIES})
447 else ()
448   set(poppler_SRCS ${poppler_SRCS}
449     poppler/JPXStream.cc
450   )
451 endif()
452 if(USE_CMS)
453   if(LCMS_FOUND)
454     set(poppler_LIBS ${poppler_LIBS} ${LCMS_LIBRARIES})
455   endif(LCMS_FOUND)
456   if(LCMS2_FOUND)
457     set(poppler_LIBS ${poppler_LIBS} ${LCMS2_LIBRARIES})
458   endif(LCMS2_FOUND)
459 endif(USE_CMS)
460 if(WIN32)
461   # gdi32 is needed under win32
462   set(poppler_LIBS ${poppler_LIBS} gdi32)
463 endif(WIN32)
464 if(PNG_FOUND)
465   set(poppler_LIBS ${poppler_LIBS} ${PNG_LIBRARIES})
466 endif(PNG_FOUND)
467 if(TIFF_FOUND)
468   set(poppler_LIBS ${poppler_LIBS} ${TIFF_LIBRARIES})
469 endif(TIFF_FOUND)
470 if(HAVE_PTHREAD)
471   set(poppler_LIBS ${poppler_LIBS} ${CMAKE_THREAD_LIBS_INIT})
472 endif()
474 if(MSVC)
475 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
476 set(CMAKE_CXX_FLAGS "/Zc:wchar_t- ${CMAKE_CXX_FLAGS}")
477 add_library(poppler STATIC ${poppler_SRCS})
478 else(MSVC)
479 add_library(poppler SHARED ${poppler_SRCS})
480 endif(MSVC)
481 set_target_properties(poppler PROPERTIES VERSION 56.0.0 SOVERSION 56)
482 target_link_libraries(poppler ${poppler_LIBS})
483 target_link_libraries(poppler LINK_INTERFACE_LIBRARIES "")
484 install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
486 if(ENABLE_XPDF_HEADERS)
487   install(FILES
488     poppler/Annot.h
489     poppler/Array.h
490     poppler/BuiltinFont.h
491     poppler/BuiltinFontTables.h
492     poppler/CachedFile.h
493     poppler/Catalog.h
494     poppler/CharCodeToUnicode.h
495     poppler/CMap.h
496     poppler/DateInfo.h
497     poppler/Decrypt.h
498     poppler/Dict.h
499     poppler/Error.h
500     poppler/FileSpec.h
501     poppler/FontEncodingTables.h
502     poppler/FontInfo.h
503     poppler/Form.h
504     poppler/Function.cc
505     poppler/Function.h
506     poppler/Gfx.h
507     poppler/GfxFont.h
508     poppler/GfxState.h
509     poppler/GfxState_helpers.h
510     poppler/GlobalParams.h
511     poppler/Hints.h
512     poppler/JArithmeticDecoder.h
513     poppler/JBIG2Stream.h
514     poppler/Lexer.h
515     poppler/Link.h
516     poppler/Linearization.h
517     poppler/LocalPDFDocBuilder.h
518     poppler/MarkedContentOutputDev.h
519     poppler/Movie.h
520     poppler/NameToCharCode.h
521     poppler/Object.h
522     poppler/OptionalContent.h
523     poppler/Outline.h
524     poppler/OutputDev.h
525     poppler/Page.h
526     poppler/PageTransition.h
527     poppler/Parser.h
528     poppler/PDFDoc.h
529     poppler/PDFDocBuilder.h
530     poppler/PDFDocEncoding.h
531     poppler/PDFDocFactory.h
532     poppler/PopplerCache.h
533     poppler/ProfileData.h
534     poppler/PreScanOutputDev.h
535     poppler/PSTokenizer.h
536     poppler/Rendition.h
537     poppler/Stream-CCITT.h
538     poppler/Stream.h
539     poppler/StructElement.h
540     poppler/StructTreeRoot.h
541     poppler/UnicodeMap.h
542     poppler/UnicodeMapTables.h
543     poppler/UnicodeTypeTable.h
544     poppler/UnicodeCClassTables.h
545     poppler/UnicodeCompTables.h
546     poppler/UnicodeDecompTables.h
547     poppler/ViewerPreferences.h
548     poppler/XRef.h
549     poppler/CharTypes.h
550     poppler/CompactFontTables.h
551     poppler/ErrorCodes.h
552     poppler/NameToUnicodeTable.h
553     poppler/PSOutputDev.h
554     poppler/TextOutputDev.h
555     poppler/SecurityHandler.h
556     poppler/StdinCachedFile.h
557     poppler/StdinPDFDocBuilder.h
558     poppler/UTF.h
559     poppler/UTF8.h
560     poppler/XpdfPluginAPI.h
561     poppler/Sound.h
562     ${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h
563     DESTINATION include/poppler)
564   install(FILES
565     goo/GooHash.h
566     goo/GooList.h
567     goo/GooTimer.h
568     goo/GooMutex.h
569     goo/GooString.h
570     goo/gtypes.h
571     goo/gmem.h
572     goo/gfile.h
573     goo/FixedPoint.h
574     goo/ImgWriter.h
575     goo/GooLikely.h
576     goo/gstrtod.h
577     goo/grandom.h
578     DESTINATION include/poppler/goo)
579   if(PNG_FOUND)
580     install(FILES
581       goo/PNGWriter.h
582       DESTINATION include/poppler/goo)
583   endif(PNG_FOUND)
584   if(TIFF_FOUND)
585     install(FILES
586       goo/TiffWriter.h
587       DESTINATION include/poppler/goo)
588   endif(TIFF_FOUND)
589   if(JPEG_FOUND)
590     install(FILES
591       goo/JpegWriter.h
592       DESTINATION include/poppler/goo)
593   endif(JPEG_FOUND)
594   install(FILES
595     fofi/FoFiBase.h
596     fofi/FoFiEncodings.h
597     fofi/FoFiTrueType.h
598     fofi/FoFiType1.h
599     fofi/FoFiType1C.h
600     fofi/FoFiIdentifier.h
601     DESTINATION include/poppler/fofi)
602   if(ENABLE_LIBCURL)
603     install(FILES
604       poppler/CurlCachedFile.h
605       poppler/CurlPDFDocBuilder.h
606       DESTINATION include/poppler)
607   endif(ENABLE_LIBCURL)
608   if(LIBOPENJPEG_FOUND)
609     install(FILES
610       poppler/JPEG2000Stream.h
611       DESTINATION include/poppler)
612   elseif(LIBOPENJPEG2_FOUND)
613     install(FILES
614       poppler/JPEG2000Stream.h
615       DESTINATION include/poppler)
616   else()
617     install(FILES
618       poppler/JPXStream.h
619       DESTINATION include/poppler)
620   endif()
621   if(ENABLE_SPLASH)
622     install(FILES
623       poppler/SplashOutputDev.h
624       DESTINATION include/poppler)
625     install(FILES
626       splash/Splash.h
627       splash/SplashBitmap.h
628       splash/SplashClip.h
629       splash/SplashErrorCodes.h
630       splash/SplashFTFont.h
631       splash/SplashFTFontEngine.h
632       splash/SplashFTFontFile.h
633       splash/SplashFont.h
634       splash/SplashFontEngine.h
635       splash/SplashFontFile.h
636       splash/SplashFontFileID.h
637       splash/SplashGlyphBitmap.h
638       splash/SplashMath.h
639       splash/SplashPath.h
640       splash/SplashPattern.h
641       splash/SplashScreen.h
642       splash/SplashState.h
643       splash/SplashT1Font.h
644       splash/SplashT1FontEngine.h
645       splash/SplashT1FontFile.h
646       splash/SplashTypes.h
647       splash/SplashXPath.h
648       splash/SplashXPathScanner.h
649       DESTINATION include/poppler/splash)
650   endif(ENABLE_SPLASH)
651 endif(ENABLE_XPDF_HEADERS)
654 if(ENABLE_UTILS)
655   add_subdirectory(utils)
656 endif(ENABLE_UTILS)
657 if(ENABLE_GLIB)
658   add_subdirectory(glib)
659 endif(ENABLE_GLIB)
660 add_subdirectory(test)
661 if(QT4_FOUND)
662   add_subdirectory(qt4)
663 endif(QT4_FOUND)
664 if(QT5_FOUND)
665   add_subdirectory(qt5)
666 endif(QT5_FOUND)
667 if(ENABLE_CPP)
668   add_subdirectory(cpp)
669 endif(ENABLE_CPP)
671 set(PKG_CONFIG_VERSION_0_18 TRUE)
672 if(PKG_CONFIG_EXECUTABLE)
673   exec_program(${PKG_CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _output_VAR)
674   macro_ensure_version("0.18" "${_output_VAR}" PKG_CONFIG_VERSION_0_18)
675 endif(PKG_CONFIG_EXECUTABLE)
676 if(PKG_CONFIG_VERSION_0_18)
677   set(PC_REQUIRES "")
678   set(PC_REQUIRES_PRIVATE "Requires.private: poppler = ${POPPLER_VERSION}")
679 else(PKG_CONFIG_VERSION_0_18)
680   set(PC_REQUIRES "poppler = ${POPPLER_VERSION}")
681   set(PC_REQUIRES_PRIVATE "")
682 endif(PKG_CONFIG_VERSION_0_18)
684 poppler_create_install_pkgconfig(poppler.pc lib${LIB_SUFFIX}/pkgconfig)
685 if(ENABLE_SPLASH)
686   poppler_create_install_pkgconfig(poppler-splash.pc lib${LIB_SUFFIX}/pkgconfig)
687 endif(ENABLE_SPLASH)
688 if(QT4_FOUND)
689   poppler_create_install_pkgconfig(poppler-qt4.pc lib${LIB_SUFFIX}/pkgconfig)
690 endif(QT4_FOUND)
691 if(QT5_FOUND)
692   poppler_create_install_pkgconfig(poppler-qt5.pc lib${LIB_SUFFIX}/pkgconfig)
693 endif(QT5_FOUND)
694 if(ENABLE_GLIB)
695   poppler_create_install_pkgconfig(poppler-glib.pc lib${LIB_SUFFIX}/pkgconfig)
696 endif(ENABLE_GLIB)
697 if(CAIRO_FOUND)
698   poppler_create_install_pkgconfig(poppler-cairo.pc lib${LIB_SUFFIX}/pkgconfig)
699 endif(CAIRO_FOUND)
700 if(ENABLE_CPP)
701   poppler_create_install_pkgconfig(poppler-cpp.pc lib${LIB_SUFFIX}/pkgconfig)
702 endif(ENABLE_CPP)
705 message("Building Poppler with support for:")
706 show_end_message("font configuration" ${font_configuration})
707 show_end_message_yesno("splash output" ENABLE_SPLASH)
708 if(SPLASH_CMYK)
709   message("      with CMYK support")
710 endif()
711 show_end_message_yesno("cairo output" CAIRO_FOUND)
712 show_end_message_yesno("qt4 wrapper" QT4_FOUND)
713 show_end_message_yesno("qt5 wrapper" QT5_FOUND)
714 show_end_message_yesno("glib wrapper" ENABLE_GLIB)
715 show_end_message_yesno("  introspection" INTROSPECTION_FOUND)
716 show_end_message_yesno("cpp wrapper" ENABLE_CPP)
717 show_end_message("use gtk-doc" "not supported with this CMake build system")
718 show_end_message_yesno("use libjpeg" ENABLE_LIBJPEG)
719 show_end_message_yesno("use libpng" ENABLE_LIBPNG)
720 show_end_message_yesno("use libtiff" ENABLE_LIBTIFF)
721 show_end_message_yesno("use zlib" ENABLE_ZLIB)
722 show_end_message_yesno("use curl" ENABLE_LIBCURL)
723 show_end_message_yesno("use libopenjpeg" WITH_OPENJPEG)
724 if(USE_OPENJPEG1)
725   message("      with openjpeg1")
726 endif()
727 if(USE_OPENJPEG2)
728   message("      with openjpeg2")
729 endif()
730 show_end_message_yesno("use cms" USE_CMS)
731 if(LCMS_FOUND)
732   message("      with lcms1")
733 endif(LCMS_FOUND)
734 if(LCMS2_FOUND)
735   message("      with lcms2")
736 endif(LCMS2_FOUND)
737 show_end_message_yesno("command line utils" ENABLE_UTILS)
738 show_end_message("test data dir" ${TESTDATADIR})
740 if(USE_FIXEDPOINT AND USE_FLOAT)
741   message("Warning: Single precision and fixed point options should not be enabled at the same time")
742 endif(USE_FIXEDPOINT AND USE_FLOAT)