def METHOD_NAME(self):
    visit = self.spec["visit"]
    args = ["-v", str(visit.version), "-clobber", "-public", self.extname + ".xml"]
    with working_dir(self.root_cmakelists_dir):
        # Regenerate the public cmake files
        if os.path.exists("CMakeLists.txt"):
            os.unlink("CMakeLists.txt")
        which("xml2cmake")(*args)
        # spack extension activate : alter VISIT_PLUGIN_DIR ;
        # xml2cmake should have set it to visit prefix but it can
        # happen the directory is an alias.
        # In that case we match version/smth/plugins.
        mstr = None
        mstr1 = r"^SET[(]VISIT_PLUGIN_DIR\s+\"{0}(.+)\"[)]".format(visit.prefix)
        mstr2 = r"^SET[(]VISIT_PLUGIN_DIR\s+\".+({0}.+?{1})\"[)]".format(
            join_path(os.sep, visit.version, ""), join_path(os.sep, "plugins")
        )
        with open("CMakeLists.txt", "r") as file:
            for line in file:
                if re.search(mstr1, line):
                    mstr = mstr1
                elif re.search(mstr2, line):
                    mstr = mstr2
        if mstr is not None:
            filter_file(
                mstr, r'SET(VISIT_PLUGIN_DIR "{0}\1")'.format(prefix), "CMakeLists.txt"
            )