Modified for compatibility with superbuild.