-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfix_generic_names_in_autogenerated_files.sh
executable file
·30 lines (26 loc) · 1.65 KB
/
fix_generic_names_in_autogenerated_files.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
#!/bin/bash
# This script renames the generic SwigRef.m, SwigMem.m, SwigGet.m and SwigStorage.m
# to yarpSwigRef.m, yarpSwigMem.m, yarpSwigGet.m and yarpSwigStorage.m to
# avoid conflicts with other projects (such as CasADi) that install
# slightly diffent files with the same name
# Workaround for https://github.com/robotology/idyntree/issues/865
# This script MUST be executed from the directory that it contains it
# Rename generic .m files
mv ./matlab/autogenerated/SwigRef.m ./matlab/autogenerated/yarpSwigRef.m
mv ./matlab/autogenerated/SwigGet.m ./matlab/autogenerated/yarpSwigGet.m
mv ./matlab/autogenerated/SwigMem.m ./matlab/autogenerated/yarpSwigMem.m
mv ./matlab/autogenerated/SwigStorage.m ./matlab/autogenerated/yarpSwigStorage.m
# Patch autogenerated files that refer to the renamed files
# see https://stackoverflow.com/questions/11392478/how-to-replace-a-string-in-multiple-files-in-linux-command-line
sed -i 's/SwigRef/yarpSwigRef/g' ./matlab/autogenerated/+yarp/*
sed -i 's/SwigGet/yarpSwigGet/g' ./matlab/autogenerated/+yarp/*
sed -i 's/SwigMem/yarpSwigMem/g' ./matlab/autogenerated/+yarp/*
sed -i 's/SwigStorage/yarpSwigStorage/g' ./matlab/autogenerated/+yarp/*
sed -i 's/SwigRef/yarpSwigRef/g' ./matlab/autogenerated/*.cxx
sed -i 's/SwigGet/yarpSwigGet/g' ./matlab/autogenerated/*.cxx
sed -i 's/SwigMem/yarpSwigMem/g' ./matlab/autogenerated/*.cxx
sed -i 's/SwigStorage/yarpSwigStorage/g' ./matlab/autogenerated/*.cxx
sed -i 's/SwigRef/yarpSwigRef/g' ./matlab/autogenerated/*.m
sed -i 's/SwigGet/yarpSwigGet/g' ./matlab/autogenerated/*.m
sed -i 's/SwigMem/yarpSwigMem/g' ./matlab/autogenerated/*.m
sed -i 's/SwigStorage/yarpSwigStorage/g' ./matlab/autogenerated/*.m