Set the version from the directory name if we are not a git tree.