-
Notifications
You must be signed in to change notification settings - Fork 0
/
export_ikfast_pybind.sh
executable file
·41 lines (38 loc) · 1.35 KB
/
export_ikfast_pybind.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
#!/bin/bash
outPath='/home/simon/git/ikfast_pybind/src/'
template="${outPath}abb_irb4600_40_255"
echo $template
files=$(ls ./export/*/*.cpp)
i=1
for j in $files; do
source[i]=$j
file[i]=$(basename ${j,,} | sed -r "s/-/_/g")
f="${file[i]%.cpp}"
folder[i]=$(echo $f | sed -r "s/ikfast61_//g")
#echo ${folder[i]}
#echo ${j%.cpp}
#echo ${source[i]}
#echo ${file[i]}
newFolder="$outPath${folder[i]}"
#echo $newFolder
cpPath="$newFolder/${file[i]}"
#echo $cpPath
mkdir "$newFolder/"
cp "$template/CMakeLists.txt" "$newFolder/"
cp "$template/ikfast.h" "$newFolder/"
cp "$template/ikfast_pybind_abb_irb4600_40_255.cpp" "$newFolder/ikfast_pybind_${folder[i]}.cpp"
cp ${source[i]} $cpPath
#echo "s/abb_irb4600_40_255/${folder[i]}/"
sed -i "s/ikfast0x10000049.Transform6D.0_1_2_3_4_5.cpp/${file[i]}/" "$newFolder/CMakeLists.txt"
sed -i "s/abb_irb4600_40_255/${folder[i]}/" "$newFolder/CMakeLists.txt"
sed -i "s/abb_irb4600_40_255/${folder[i]}/" "$newFolder/ikfast_pybind_${folder[i]}.cpp"
#echo "${folder[i]}" "${outPath}CMakeLists.txt"
#echo $(grep "${folder[i]} ${outPath}CMakeLists.txt")
if grep ${folder[i]} "${outPath}CMakeLists.txt"
then
echo "exists"
else
echo "add_subdirectory(${folder[i]})" >> "${outPath}CMakeLists.txt"
fi
i=$(( i + 1 ))
done