Source

rbdl / utils / include_change.sh

Full commit
#!/bin/bash

# Go through and change includes for RBDL to use prefix 'rbdl/'

# Using: http://stackoverflow.com/questions/11003418/calling-functions-with-xargs-within-a-bash-script
function rbdl_include_change()
{
	# Could probably just make this a for loop. Meh
	# Couldn't add a redirection at the very end, so just resorted to a hack
	sed 's/#include "/#include "rbdl\//g' $1 \
		| bash -c "cat > '$1'"
#		| sed 's/#include <rbdl_/#include <rbdl\/rbdl_/g' \
#		| sed 's/#include "rbdl\/Eigen/#include "Eigen/g' \
}
export -f rbdl_include_change

function rbdl_do_it()
{
	find $1 -type f -print0 | xargs -0 -n 1 bash -c 'rbdl_include_change $1' _
}

# Run from base directory

#rbdl_do_it ./include
#rbdl_do_it ./src

# Make sure plugin is changed as well
#sed -i 's/#define EIGEN_MATRIX_PLUGIN "MatrixAddons.h"/#define EIGEN_MATRIX_PLUGIN "rbdl\/MatrixAddons.h"/g' ./include/rbdl/rbdl_math.h

rbdl_do_it ./tests