def _do_subproject_cmake(self, subp_name: str, subdir: str, subdir_abs: str, default_options: T.Dict[(OptionKey, str)], kwargs: kwargs.DoSubproject) -> SubprojectHolder:
    with mlog.nested(subp_name):
        new_build = self.build.copy()
        prefix = self.coredata.options[OptionKey('prefix')].value
        from ..modules.cmake import CMakeSubprojectOptions
        options = (kwargs['options'] or CMakeSubprojectOptions())
        cmake_options = (kwargs['cmake_options'] + options.cmake_options)
        cm_int = CMakeInterpreter(new_build, Path(subdir), Path(subdir_abs), Path(prefix), new_build.environment, self.backend)
        cm_int.initialise(cmake_options)
        cm_int.analyse()
        ast = cm_int.pretend_to_be_meson(options.target_options)
        mlog.log()
        with mlog.nested('cmake-ast'):
            mlog.log('Processing generated meson AST')
            from ..ast import AstIndentationGenerator, AstPrinter
            printer = AstPrinter()
            ast.accept(AstIndentationGenerator())
            ast.accept(printer)
            printer.post_process()
            meson_filename = os.path.join(self.build.environment.get_build_dir(), subdir, 'meson.build')
            with open(meson_filename, 'w', encoding='utf-8') as f:
                f.write(printer.result)
            mlog.log('Build file:', meson_filename)
            mlog.cmd_ci_include(meson_filename)
            mlog.log()
        result = self._do_subproject_meson(subp_name, subdir, default_options, kwargs, ast, [str(f) for f in cm_int.bs_files], is_translated=True)
        result.cm_interpreter = cm_int
    mlog.log()
    return result
def _do_subproject_cmake(self, subp_name: str, subdir: str, subdir_abs: str, default_options: T.Dict[(OptionKey, str)], kwargs: kwargs.DoSubproject) -> SubprojectHolder:
    with mlog.nested(subp_name):
        new_build = self.build.copy()
        prefix = self.coredata.options[OptionKey('prefix')].value
        from ..modules.cmake import CMakeSubprojectOptions
        options = (kwargs['options'] or CMakeSubprojectOptions())
        cmake_options = (kwargs['cmake_options'] + options.cmake_options)
        cm_int = CMakeInterpreter(new_build, Path(subdir), Path(subdir_abs), Path(prefix), new_build.environment, self.backend)
        cm_int.initialise(cmake_options)
        cm_int.analyse()
        ast = cm_int.pretend_to_be_meson(options.target_options)
        mlog.log()
        with mlog.nested('cmake-ast'):
            mlog.log('Processing generated meson AST')
            from ..ast import AstIndentationGenerator, AstPrinter
            printer = AstPrinter()
            ast.accept(AstIndentationGenerator())
            ast.accept(printer)
            printer.post_process()
            meson_filename = os.path.join(self.build.environment.get_build_dir(), subdir, 'meson.build')
            with open(meson_filename, 'w', encoding='utf-8') as f:
                f.write(printer.result)
            mlog.log('Build file:', meson_filename)
            mlog.cmd_ci_include(meson_filename)
            mlog.log()
        result = self._do_subproject_meson(subp_name, subdir, default_options, kwargs, ast, [str(f) for f in cm_int.bs_files], is_translated=True)
        result.cm_interpreter = cm_int
    mlog.log()
    return result