I had problems using emacs ECB when the class definitions were preceeded by an
EXPORT macro, so I finally wrote a script for stripping them from the files.
If anybody is interested in doing this, here's the script. I do a `make
INST_LOCATION=$OSG install' with OSG set to a directory in my user space.
The script just traverses the include directory, mirroring it to a temporary
directory and then seds each of the files containing any *_EXPORT not
preceeded by a '#' back into the $OSG/include/osg* where it originated. If
everything works, you can rm -r on the $OSG/tmp. If not, hopefully the stuff
in the tmp directory will be intact.
#!/bin/bash
# use at your own risk
function fail { echo "Error: $1" && exit -1 }
[ -n "$OSG" ] || fail "Need to set \$OSG"
TEMP_DIR=$OSG/tmp
[ -e $TEMP_DIR ] || mkdir $TEMP_DIR
[ -d $TEMP_DIR ] || fail "Failed to find or create directory $OSG/tmp"
[ -d $OSG/include ] || fail "Directory $OSG/include does not exist"
for sc in $(find $OSG -name semantic.cache); rm $sc;done
function traverse {
pushd $1 > /dev/null
echo "traversing $PWD"
local td=$2/$1
[ -e $td ] || mkdir $td
[ -d $td ] || fail "Failed to find or create directory $td"
for d in $(find . -maxdepth 1 -mindepth 1 -type d); do traverse ${d#./}
$td; done
for f in $(find . -maxdepth 1 -mindepth 1 -type f); do
local tf=$td/${f#./}
cp ${f#./} $tf;
[ -f $tf ] || fail "failed to create $tf"
local gs="";
gs=$(grep _EXPORT $tf | grep -v \#)
[ -n "$gs" ] && eval "sed -e 's/[A-Z]*_EXPORT//g' $tf > $f"
done
popd > /dev/null
}
pushd $OSG > /dev/null
traverse include $TEMP_DIR
popd > /dev/null
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/