/
prebuild.sh
executable file
·143 lines (109 loc) · 3.58 KB
/
prebuild.sh
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
#!/bin/bash
#
# MOC & UIC
# @author Tobias Weber <tobias.weber@tum.de>
# @license GPLv2
#
if [[ $# -ge 3 ]]; then
UIC="$1"
MOC="$2"
TAKINROOT="$3"
FORCE=0
else
UIC="$(which uic-qt4)"
MOC="$(which moc-qt4)"
# UIC="$(which uic-qt5)"
# MOC="$(which moc-qt5)"
if [ $? -ne 0 ]; then
UIC="$(which uic)"
MOC="$(which moc)"
fi
TAKINROOT=.
FORCE=1 # force rebuild when manually called
fi
if [ -z "$UIC" ] || [ -z "${MOC}" ]; then
echo "Error: moc/uic tools not found!";
exit -1;
fi
echo -e "Using UIC: ${UIC}\nUsing MOC: ${MOC}\n"
echo -e "--------------------------------------------------------------------------------"
echo -e "building uis..."
cd "${TAKINROOT}/ui"
for file in *.ui; do
outfile=ui_${file%\.ui}.h
if [ ! -e ${outfile} -o "${FORCE}" -eq "1" ]; then
echo -e "${file} -> ${outfile}"
${UIC} ${file} -o ${outfile}
fi
done
cd ..
echo -e "--------------------------------------------------------------------------------"
echo -e "\n"
echo -e "--------------------------------------------------------------------------------"
echo -e "building mocs..."
declare -a hfiles=(
"${TAKINROOT}/tools/taz/taz.h"
"${TAKINROOT}/tools/taz/scattering_triangle.h"
"${TAKINROOT}/tools/taz/real_lattice.h"
"${TAKINROOT}/tools/taz/proj_lattice.h"
"${TAKINROOT}/tools/taz/tas_layout.h"
"${TAKINROOT}/tools/taz/tof_layout.h"
"${TAKINROOT}/tools/taz/recip3d.h"
"${TAKINROOT}/tools/taz/real3d.h"
"${TAKINROOT}/tools/taz/bz3d.h"
"${TAKINROOT}/tools/taz/net.h"
"${TAKINROOT}/tools/taz/nicos.h"
"${TAKINROOT}/tools/taz/sics.h"
"${TAKINROOT}/tools/res/ResoDlg.h"
"${TAKINROOT}/tools/scanviewer/scanviewer.h"
"${TAKINROOT}/tools/scanviewer/FitParamDlg.h"
"${TAKINROOT}/tools/monteconvo/ConvoDlg.h"
"${TAKINROOT}/tools/monteconvo/SqwParamDlg.h"
"${TAKINROOT}/tools/sglist/SgListDlg.h"
"${TAKINROOT}/tools/scanpos/ScanPosDlg.h"
"${TAKINROOT}/tools/powderfit/PowderFitDlg.h"
"${TAKINROOT}/dialogs/EllipseDlg.h"
"${TAKINROOT}/dialogs/EllipseDlg3D.h"
"${TAKINROOT}/dialogs/RecipParamDlg.h"
"${TAKINROOT}/dialogs/RealParamDlg.h"
"${TAKINROOT}/dialogs/SpurionDlg.h"
"${TAKINROOT}/dialogs/NeutronDlg.h"
"${TAKINROOT}/dialogs/TOFDlg.h"
"${TAKINROOT}/dialogs/SrvDlg.h"
"${TAKINROOT}/dialogs/GotoDlg.h"
"${TAKINROOT}/dialogs/FavDlg.h"
"${TAKINROOT}/dialogs/AtomsDlg.h"
"${TAKINROOT}/dialogs/NetCacheDlg.h"
"${TAKINROOT}/dialogs/ScanMonDlg.h"
"${TAKINROOT}/dialogs/PowderDlg.h"
"${TAKINROOT}/dialogs/SettingsDlg.h"
"${TAKINROOT}/dialogs/DWDlg.h"
"${TAKINROOT}/dialogs/DynPlaneDlg.h"
"${TAKINROOT}/dialogs/FilePreviewDlg.h"
"${TAKINROOT}/tools/ffact/FormfactorDlg.h"
"${TAKINROOT}/dialogs/AboutDlg.h"
"${TAKINROOT}/dialogs/DispDlg.h"
"${TAKINROOT}/dialogs/DeadAnglesDlg.h"
"${TAKINROOT}/dialogs/LogDlg.h"
"${TAKINROOT}/libs/qt/qwthelper.h"
)
for hfile in ${hfiles[@]}; do
mocfile=${hfile%\.h}.moc
if [ ! -e ${mocfile} -o "${FORCE}" -eq "1" ]; then
echo -e "${hfile} -> ${mocfile}"
${MOC} ${hfile} -o ${mocfile}
fi
done
echo -e "--------------------------------------------------------------------------------"
echo -e "\n"
echo -e "--------------------------------------------------------------------------------"
echo -e "building docs..."
qcollectiongenerator ${TAKINROOT}/doc/takin.qhcp -o ${TAKINROOT}/doc/takin.qhc
cp -v ${TAKINROOT}/doc/takin.qhc ${TAKINROOT}/res/doc/
cp -v ${TAKINROOT}/doc/takin.qch ${TAKINROOT}/res/doc/
echo -e "--------------------------------------------------------------------------------"
echo -e "building devel docs..."
cd ${TAKINROOT}
doxygen tastools-doc
echo -e "--------------------------------------------------------------------------------"
exit 0