source: gs2-extensions/xpdf-tools/trunk/src/packages/CMakeLists.txt@ 32228

Last change on this file since 32228 was 32228, checked in by ak19, 6 years ago

Tried to compile xpdf-tools up statically with CMake, but still not successful. For now committing modifications necessary (including the new additional packages) for compiling xpdf-tools agains dynamically linked libs of libpng and zlib and freetype. Although these 3 packages have been introduced and are successfully compiled up (and I can even get the CMake configure stage of xpdf-tools to 'see' them), the xpdftools binaries upon successful compilation are shown by ldd to still refer to system versions of zlib, libpng and freetype. Some modifications to a single file in the xpdftools src package were necessary to get things to compile again with these changes, so recommitting the xpdftools src package with modications using the usual gs- prefix and a readme.

File size: 5.7 KB
Line 
1#========================================================================
2#
3# xpdf/cmake-xpdf.txt
4#
5# CMake script for the Xpdf tools.
6#
7# Copyright 2015 Glyph & Cog, LLC
8#
9#========================================================================
10
11include_directories("${PROJECT_SOURCE_DIR}")
12include_directories("${PROJECT_BINARY_DIR}")
13include_directories("${PROJECT_SOURCE_DIR}/goo")
14include_directories("${PROJECT_SOURCE_DIR}/fofi")
15include_directories("${PROJECT_SOURCE_DIR}/splash")
16if (PNG_FOUND)
17 include_directories("${PNG_INCLUDE_DIRS}")
18 add_definitions("${PNG_DEFINITIONS}")
19endif ()
20# https://stackoverflow.com/questions/36126333/mingw-cmake-undefined-reference-to-zlib
21if (ZLIB_FOUND)
22 include_directories("${ZLIB_INCLUDE_DIRS}")
23 add_definitions("${ZLIB_DEFINITIONS}")
24endif ()
25if (HAVE_LCMS)
26 include_directories("${LCMS_INCLUDE_DIR}")
27 set(COLOR_MANAGER_SOURCE "ColorManager.cc")
28else ()
29 set(COLOR_MANAGER_SOURCE "")
30endif ()
31
32add_library(xpdf_objs OBJECT
33 AcroForm.cc
34 Annot.cc
35 Array.cc
36 BuiltinFont.cc
37 BuiltinFontTables.cc
38 Catalog.cc
39 CharCodeToUnicode.cc
40 CMap.cc
41 ${COLOR_MANAGER_SOURCE}
42 Decrypt.cc
43 Dict.cc
44 Error.cc
45 FontEncodingTables.cc
46 Form.cc
47 Function.cc
48 Gfx.cc
49 GfxFont.cc
50 GfxState.cc
51 GlobalParams.cc
52 JArithmeticDecoder.cc
53 JBIG2Stream.cc
54 JPXStream.cc
55 Lexer.cc
56 Link.cc
57 NameToCharCode.cc
58 Object.cc
59 OptionalContent.cc
60 Outline.cc
61 OutputDev.cc
62 Page.cc
63 Parser.cc
64 PDFDoc.cc
65 PDFDocEncoding.cc
66 PSTokenizer.cc
67 SecurityHandler.cc
68 Stream.cc
69 TextString.cc
70 UnicodeMap.cc
71 UnicodeTypeTable.cc
72 UTF8.cc
73 XFAForm.cc
74 XRef.cc
75 Zoox.cc
76)
77
78#--- object files needed by XpdfWidget
79
80if ((QT4_FOUND OR Qt5Widgets_FOUND)
81 AND HAVE_SPLASH AND MULTITHREADED AND USE_EXCEPTIONS)
82
83 if (HIGHLIGHTED_REGIONS)
84 set(HIGHLIGHT_SRC "HighlightFile.cc")
85 else ()
86 set(HIGHLIGHT_SRC "")
87 endif ()
88
89 add_library(xpdf_widget_objs OBJECT
90 DisplayState.cc
91 PDFCore.cc
92 PreScanOutputDev.cc
93 PSOutputDev.cc
94 SplashOutputDev.cc
95 TextOutputDev.cc
96 TileCache.cc
97 TileCompositor.cc
98 TileMap.cc
99 ${HIGHLIGHT_SRC}
100 )
101endif ()
102
103#--- pdftops
104
105if (HAVE_SPLASH)
106 add_executable(pdftops
107 $<TARGET_OBJECTS:xpdf_objs>
108 PreScanOutputDev.cc
109 PSOutputDev.cc
110 SplashOutputDev.cc
111 pdftops.cc
112 )
113 target_link_libraries(pdftops goo fofi splash
114 ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
115 ${ZLIB_LIBRARIES}
116 ${DTYPE_LIBRARY}
117 ${LCMS_LIBRARY})
118else ()
119 add_executable(pdftops
120 $<TARGET_OBJECTS:xpdf_objs>
121 PreScanOutputDev.cc
122 PSOutputDev.cc
123 pdftops.cc
124 )
125 target_link_libraries(pdftops goo fofi ${LCMS_LIBRARY})
126endif ()
127install(TARGETS pdftops RUNTIME DESTINATION bin)
128install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftops.1 DESTINATION man/man1)
129
130#--- pdftotext
131
132add_executable(pdftotext
133 $<TARGET_OBJECTS:xpdf_objs>
134 TextOutputDev.cc
135 pdftotext.cc
136)
137target_link_libraries(pdftotext goo fofi ${LCMS_LIBRARY})
138install(TARGETS pdftotext RUNTIME DESTINATION bin)
139install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftotext.1 DESTINATION man/man1)
140
141#--- pdftohtml
142
143if (HAVE_SPLASH AND PNG_FOUND)
144 add_executable(pdftohtml
145 $<TARGET_OBJECTS:xpdf_objs>
146 HTMLGen.cc
147 SplashOutputDev.cc
148 TextOutputDev.cc
149 pdftohtml.cc
150 )
151 target_link_libraries(pdftohtml goo fofi splash
152 ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
153 ${DTYPE_LIBRARY}
154 ${LCMS_LIBRARY} ${PNG_LIBRARIES})
155 install(TARGETS pdftohtml RUNTIME DESTINATION bin)
156 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftohtml.1 DESTINATION man/man1)
157endif ()
158
159#--- pdfinfo
160
161add_executable(pdfinfo
162 $<TARGET_OBJECTS:xpdf_objs>
163 pdfinfo.cc
164)
165target_link_libraries(pdfinfo goo fofi ${LCMS_LIBRARY})
166install(TARGETS pdfinfo RUNTIME DESTINATION bin)
167install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfinfo.1 DESTINATION man/man1)
168
169#--- pdffonts
170
171add_executable(pdffonts
172 $<TARGET_OBJECTS:xpdf_objs>
173 pdffonts.cc
174)
175target_link_libraries(pdffonts goo fofi ${LCMS_LIBRARY})
176install(TARGETS pdffonts RUNTIME DESTINATION bin)
177install(FILES ${PROJECT_SOURCE_DIR}/doc/pdffonts.1 DESTINATION man/man1)
178
179#--- pdfdetach
180
181add_executable(pdfdetach
182 $<TARGET_OBJECTS:xpdf_objs>
183 pdfdetach.cc
184)
185target_link_libraries(pdfdetach goo fofi ${LCMS_LIBRARY})
186install(TARGETS pdfdetach RUNTIME DESTINATION bin)
187install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfdetach.1 DESTINATION man/man1)
188
189#--- pdftoppm
190
191if (HAVE_SPLASH)
192 add_executable(pdftoppm
193 $<TARGET_OBJECTS:xpdf_objs>
194 SplashOutputDev.cc
195 pdftoppm.cc
196 )
197 target_link_libraries(pdftoppm goo fofi splash
198 ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
199 ${ZLIB_LIBRARIES}
200 ${DTYPE_LIBRARY}
201 ${LCMS_LIBRARY})
202 install(TARGETS pdftoppm RUNTIME DESTINATION bin)
203 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftoppm.1 DESTINATION man/man1)
204endif ()
205
206#--- pdftopng
207
208if (HAVE_SPLASH AND PNG_FOUND)
209 add_executable(pdftopng
210 $<TARGET_OBJECTS:xpdf_objs>
211 SplashOutputDev.cc
212 pdftopng.cc
213 )
214 target_link_libraries(pdftopng goo fofi splash
215 ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
216 ${DTYPE_LIBRARY}
217 ${LCMS_LIBRARY} ${PNG_LIBRARIES})
218 install(TARGETS pdftopng RUNTIME DESTINATION bin)
219 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftopng.1 DESTINATION man/man1)
220endif ()
221
222#--- pdfimages
223
224add_executable(pdfimages
225 $<TARGET_OBJECTS:xpdf_objs>
226 ImageOutputDev.cc
227 pdfimages.cc
228)
229target_link_libraries(pdfimages goo fofi ${LCMS_LIBRARY})
230install(TARGETS pdfimages RUNTIME DESTINATION bin)
231install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfimages.1 DESTINATION man/man1)
232
233#--- xpdfrc man page
234
235install(FILES ${PROJECT_SOURCE_DIR}/doc/xpdfrc.5 DESTINATION man/man5)
Note: See TracBrowser for help on using the repository browser.