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

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