-
Notifications
You must be signed in to change notification settings - Fork 1
/
gsview.pro
196 lines (161 loc) · 5.74 KB
/
gsview.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#-------------------------------------------------
#
# Project created by QtCreator 2014-08-15T14:36:31
#
#-------------------------------------------------
# C and C++ compiler configuration
#QMAKE_MAC_SDK = macosx10.13 # for Xcode 7.2
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
CONFIG += c++11
QMAKE_CXXFLAGS += -std=c++11
macx: QMAKE_CXXFLAGS += -stdlib=libstdc++
# include file paths
INCPATH+=.
INCPATH+=mupdf/include
# Linux/release: look for shared libs in ./libs
CONFIG(release,debug|release) {
unix:!macx {
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/libs\''
}
}
# turn off warnings
CONFIG += warn_off
# preprocessor
DEFINES += _QT
macx: DEFINES += _QT_MAC
# CUPS is not currently working.
#unix: DEFINES += USE_CUPS
win32: DEFINES += _QT_WIN
# debugging can be easier if we don't use native file dialogs
DEFINES += USE_NATIVE_FILE_DIALOGS=true
# Qt configuration
QT += core gui
qtHaveModule(printsupport): QT += printsupport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = gsview
TEMPLATE = app
# various files
HEADERS = \
muctx.h \
status.h \
Cache.h \
Window.h \
Document.h \
QtUtil.h \
ScrollingImageList.h \
ImageWidget.h \
ThumbnailList.h \
PageList.h \
Printer.h \
AboutDialog.h \
FileInfoDialog.h \
ContentsList.h \
FileSave.h \
MessagesDialog.h \
GSViewApp.h \
FileSaveDialog.h \
ExtractPagesDialog.h \
ICCDialog.h \
ICCDialog2.h \
SelectionFrame.h \
PrintDialog.h \
ColorsDialog.h \
ProofSettingsDialog.h
SOURCES = \
main.cpp \
muctx.cpp \
Cache.cpp \
Window.cpp \
Document.cpp \
QtUtil.cpp \
ScrollingImageList.cpp \
ImageWidget.cpp \
ThumbnailList.cpp \
PageList.cpp \
Printer.cpp \
AboutDialog.cpp \
FileInfoDialog.cpp \
ContentsList.cpp \
FileSave.cpp \
mupdf/source/tools/pdfclean.c \
MessagesDialog.cpp \
GSViewApp.cpp \
FileSaveDialog.cpp \
ExtractPagesDialog.cpp \
ICCDialog.cpp \
ICCDialog2.cpp \
SelectionFrame.cpp \
PrintDialog.cpp \
ColorsDialog.cpp \
ProofSettingsDialog.cpp
FORMS += \
Window.ui \
AboutDialog.ui \
FileInfoDialog.ui \
MessagesDialog.ui \
ExtractPagesDialog.ui \
ICCDialog.ui \
ICCDialog2.ui \
PrintDialog.ui \
filedialogextension.ui \
ColorsDialog.ui \
ProofSettingsDialog.ui
RESOURCES += \
resources.qrc
# Libraries to link to
# the order of the libraries here is very important.
LIBS += -L$$PWD/mupdf/build/release
unix: LIBS += -lmupdf -lmupdfthird -lmutools
# not using CUPS
#unix: LIBS += -lcups
#unix: LIBS += -lssl -lcrypto
#unix: LIBS += $$PWD/ghostpdl/gs.a
#unix: LIBS += $$PWD/ghostpdl/sobin/libgs.dylib
# copy executable files from ghostpdl
# also create a symbolic link for gswin32c.exe to gs, to satisfy the proofing code in mupdf.
# we add the path to our "apps" folder to PATH so that gs, gxps, and gswin32c.exe are found.
unix:!macx {
QMAKE_POST_LINK += $$quote(mkdir -p $$OUT_PWD/apps $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$PWD/ghostpdl/bin/gs $$OUT_PWD/apps/gs $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$PWD/ghostpdl/bin/gxps $$OUT_PWD/apps/gxps $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(ln -sf gs $$OUT_PWD/apps/gswin32c.exe $$escape_expand(\n\t))
}
macx {
QMAKE_POST_LINK += $$quote(mkdir -p $$OUT_PWD/gsview.app/Contents/MacOS/apps $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$PWD/ghostpdl/bin/gs $$OUT_PWD/gsview.app/Contents/MacOS/apps/gs $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$PWD/ghostpdl/bin/gxps $$OUT_PWD/gsview.app/Contents/MacOS/apps/gxps $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(ln -sf gs $$OUT_PWD/gsview.app/Contents/MacOS/apps/gswin32c.exe $$escape_expand(\n\t))
}
# mac: icon and plist file
macx {
ICON = resources/gsview_app.icns
QMAKE_POST_LINK += $$quote(cp $$PWD/resources/gsview_mac.plist $$OUT_PWD/gsview.app/Contents/Info.plist $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$PWD/resources/gsview_app.icns $$OUT_PWD/gsview.app/Contents/Resources/gsview_app.icns $$escape_expand(\n\t))
}
# documentation
macx {
QMAKE_POST_LINK += $$quote(cp $$PWD/UserGuide.pdf $$OUT_PWD/gsview.app/Contents/Resources/UserGuide.pdf $$escape_expand(\n\t))
}
unix:!macx {
QMAKE_POST_LINK += $$quote(cp $$PWD/UserGuide.pdf $$OUT_PWD/UserGuide.pdf $$escape_expand(\n\t))
}
# post-link step to get some shared files for the release build
CONFIG(release,debug|release) {
unix:!macx {
# this assumes a relative position of these dirs relative to qmake
QTLIBPATH = $$clean_path($$dirname(QMAKE_QMAKE)/..)/lib
QTPLUGINPATH = $$clean_path($$dirname(QMAKE_QMAKE)/..)/plugins/platforms
QMAKE_POST_LINK += $$quote(rm -rf ./libs $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(mkdir -p ./libs $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(rm -rf ./platforms $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(mkdir -p ./platforms $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$QTLIBPATH/libQt5PrintSupport.so.5 ./libs/libQt5PrintSupport.so.5 $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$QTLIBPATH/libQt5Widgets.so.5 ./libs/libQt5Widgets.so.5 $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$QTLIBPATH/libQt5Gui.so.5 ./libs/libQt5Gui.so.5 $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$QTLIBPATH/libQt5Core.so.5 ./libs/libQt5Core.so.5 $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$QTLIBPATH/libQt5DBus.so.5 ./libs/libQt5DBus.so.5 $$escape_expand(\n\t))
QMAKE_POST_LINK += $$quote(cp $$QTPLUGINPATH/libqxcb.so ./platforms/libqxcb.so $$escape_expand(\n\t))
}
}
DISTFILES += \
UserGuide.pdf