def _do_subproject_cmake(self, dirname, subdir, subdir_abs, default_options, kwargs):
    with mlog.nested():
        new_build = self.build.copy()
        prefix = self.coredata.builtins['prefix'].value
        cmake_options = mesonlib.stringlistify(kwargs.get('cmake_options', []))
        cm_int = CMakeInterpreter(new_build, subdir, subdir_abs, prefix, new_build.environment, self.backend)
        cm_int.initialise(cmake_options)
        cm_int.analyse()
        ast = cm_int.pretend_to_be_meson()
        mlog.log()
        with mlog.nested():
            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') 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(dirname, subdir, default_options, kwargs, ast, cm_int.bs_files)
        result.cm_interpreter = cm_int
    mlog.log()
    return result
def _do_subproject_cmake(self, dirname, subdir, subdir_abs, default_options, kwargs):
    with mlog.nested():
        new_build = self.build.copy()
        prefix = self.coredata.builtins['prefix'].value
        cmake_options = mesonlib.stringlistify(kwargs.get('cmake_options', []))
        cm_int = CMakeInterpreter(new_build, subdir, subdir_abs, prefix, new_build.environment, self.backend)
        cm_int.initialise(cmake_options)
        cm_int.analyse()
        ast = cm_int.pretend_to_be_meson()
        mlog.log()
        with mlog.nested():
            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') 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(dirname, subdir, default_options, kwargs, ast, cm_int.bs_files)
        result.cm_interpreter = cm_int
    mlog.log()
    return result