forked from niftools/nifskope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NifSkope_targets.pri
161 lines (126 loc) · 4 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
###############################
## 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
###############################
## 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}
out = $$syspath($${OUT_PWD})
# Find out if release or debug because DESTDIR is blank
exists($$out/debug/NifSkope.exe):outdoc = $$syspath($${out}/debug/doc)
exists($$out/release/NifSkope.exe):outdoc = $$syspath($${out}/release/doc)
# COMMANDS
docs.commands += $${QMAKE_CHK_DIR_EXISTS} $${outdoc} $${QMAKE_MKDIR} $${outdoc} $$nt
docs.commands += cd $${docsys} $$nt # cd ./build/docsys
docs.commands += python nifxml_doc.py $$nt # invoke python
# Move *.html files out of ./build/docsys/doc
win32:docs.commands += move /Y $${indoc}*.html $${outdoc} $$nt
else:docs.commands += mv -f $${indoc}*.html $${outdoc} $$nt
# Copy CSS and ICO
docs.commands += $${QMAKE_COPY} $${indoc}*.* $${outdoc} $$nt
# 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 = $$syspath($$[QT_INSTALL_BINS]/qhelpgenerator.exe)
dot = $$syspath(C:/Program Files (x86)/Graphviz2.37/bin) # TODO
_7z = $$get7z()
# Doxyfile.in Replacements
INPUT = $$re_escape($$syspath($${PWD}/src))
OUTPUT = $$re_escape($$syspath($${OUT_PWD}/apidocs))
ROOT = $$re_escape($$syspath($${PWD}))
GENERATE_QHP = NO
exists($$qhgen):GENERATE_QHP = YES
HAVE_DOT = NO
DOT_PATH = ""
exists($$dot) {
HAVE_DOT = YES
DOT_PATH = $$re_escape($${dot})
}
TAGS = $$syspath($${PWD}/build/doxygen/tags)
BINS = $$re_escape($$syspath($$[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} $${TAGS}$${QMAKE_DIR_SEP}tags.zip -o -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)