The correct sintax is with PROGRAMS instead of FILES and using the BIN destination, not the SHARE one.
install(PROGRAMS scripts/foo.sh