-
Notifications
You must be signed in to change notification settings - Fork 232
/
NifSkope_targets.pri
189 lines (150 loc) · 4.83 KB
/
NifSkope_targets.pri
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
###############################
## TARGETS
###############################
# Note: dir or file in build dir cannot be named the same as the target
# e.g. "docs" target will fail if a "docs" folder is in OUT_PWD
win32:EXE = ".exe"
else:EXE = ""
###############################
## lupdate / lrelease
###############################
QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate$${EXE}
exists($$QMAKE_LUPDATE) {
# Make target for Updating .ts
updatets.target = updatets
updatets.commands += cd $${_PRO_FILE_PWD_} && $$[QT_INSTALL_BINS]/lupdate $${_PRO_FILE_} $$nt
updatets.CONFIG += no_check_exist no_link no_clean
QMAKE_EXTRA_TARGETS += updatets
} else {
message("lupdate could not be found, ignoring make target")
}
QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease$${EXE}
exists($$QMAKE_LRELEASE) {
# Build Step for Releasing .ts->.qm
updateqm.input = TRANSLATIONS
updateqm.output = $$syspath($${DESTDIR}/lang/${QMAKE_FILE_BASE}.qm)
updateqm.commands = $$[QT_INSTALL_BINS]/lrelease ${QMAKE_FILE_IN} -qm $$syspath($${DESTDIR}/lang/${QMAKE_FILE_BASE}.qm) $$nt
updateqm.CONFIG += no_check_exist no_link no_clean target_predeps
QMAKE_EXTRA_COMPILERS += updateqm
} else {
message("lrelease could not be found, ignoring build step")
}
###############################
## Docsys
###############################
# Creates NIF docs for NifSkope release
#
# Requirements:
# Python, jom (or make/mingw32-make)
#
# Usage:
# jom release-docs
#
# "release-docs" is an alias for:
# jom -f Makefile.Release docs
#______________________________
docs.target = docs
# Vars
docsys = $$syspath($${PWD}/build/docsys)
indoc = doc$${QMAKE_DIR_SEP}
outdoc = $$syspath($${DESTDIR}/doc)
# COMMANDS
docs.commands += $$sprintf($$QMAKE_MKDIR_CMD, $${outdoc}) $$nt
docs.commands += cd $${docsys} # cd ./build/docsys
docs.commands += && python nifxml_doc.py # invoke python
# Move *.html files out of ./build/docsys/doc
win32:docs.commands += && move /Y $${indoc}*.html $${outdoc}
else:docs.commands += && mv -f $${indoc}*.html $${outdoc}
# Copy CSS and ICO
docs.commands += && $${QMAKE_COPY} $${indoc}*.* $${outdoc}
# Clean up .pyc files so submodule doesn't become "dirty"
docs.commands += && $${QMAKE_DEL_FILE} *.pyc $$nt
docs.CONFIG += recursive
###############################
## Doxygen
###############################
# Creates NifSkope API docs
#
# Requirements:
# Doxygen (http://www.stack.nl/~dimitri/doxygen/download.html)
# sed
# - Windows: http://gnuwin32.sourceforge.net/packages/sed.htm
# jom (or make/mingw32-make)
# To automatically extract tags.zip:
# 7-zip (Windows)
# unzip (Linux)
#
# Usage:
# jom release-doxygen
#
# "release-doxygen" is an alias for:
#
# jom -f Makefile.Release doxygen
#______________________________
doxygen.target = doxygen
# Vars
doxyfile = $$syspath($${OUT_PWD}/Doxyfile)
doxyfilein = $$syspath($${PWD}/build/doxygen/Doxyfile.in)
# Paths
qhgen = $$[QT_INSTALL_BINS]/qhelpgenerator$${EXE}
win32:dot = C:/Program Files (x86)/Graphviz2.38/bin
unix:dot = $$system(which dot 2>/dev/null)
_7z = $$get7z()
# Doxyfile.in Replacements
INPUT = $$re_escape($${PWD}/src)
OUTPUT = $$re_escape($${OUT_PWD}/apidocs)
ROOT = $$re_escape($${PWD})
GENERATE_QHP = NO
exists($$qhgen):GENERATE_QHP = YES
HAVE_DOT = NO
DOT_PATH = " " # Using space because sed on Windows errors on s%@DOT_PATH@%%g for some reason
exists($$dot) {
HAVE_DOT = YES
DOT_PATH = $$re_escape($${dot})
}
TAGS = $${PWD}/build/doxygen/tags
BINS = $$re_escape($$[QT_INSTALL_BINS])
# Find `sed` command
SED = $$getSed()
# Parse Doxyfile.in
!isEmpty(SED) {
!isEmpty(_7z) {
win32:doxygen.commands += $${_7z} x $${TAGS}$${QMAKE_DIR_SEP}tags.zip \"-o$${TAGS}\" -aoa $$nt
unix:doxygen.commands += $${_7z} -o $${TAGS}$${QMAKE_DIR_SEP}tags.zip -d $${TAGS} $$nt
}
doxygen.commands += $${SED} -e \"s%@VERSION@%$$getVersion()%g;\
s%@REVISION@%$$getRevision()%g;\
s%@OUTPUT@%$${OUTPUT}%g;\
s%@INPUT@%$${INPUT}%g;\
s%@PWD@%$${ROOT}%g;\
s%@QT_VER@%$$QtHex()%g;\
s%@GENERATE_QHP@%$${GENERATE_QHP}%g;\
s%@HAVE_DOT@%$${HAVE_DOT}%g;\
s%@DOT_PATH@%$${DOT_PATH}%g;\
s%@QT_INSTALL_BINS@%$${BINS}%g\" \
$${doxyfilein} > $${doxyfile} $$nt
# Run Doxygen
doxygen.commands += doxygen $${doxyfile} $$nt
} else {
} # end isEmpty
doxygen.CONFIG += recursive
###############################
## ADD TARGETS
###############################
QMAKE_EXTRA_TARGETS += docs doxygen
# Unset Vars
unset(docsys)
unset(indoc)
unset(out)
unset(outdoc)
unset(doxyfilein)
unset(doxyfile)
unset(INPUT)
unset(OUTPUT)
unset(ROOT)
unset(GENERATE_QHP)
unset(HAVE_DOT)
unset(DOT_PATH)
unset(BINS)
unset(TAGS)
unset(_7z)