docstr: Generate CMakeList file from template.
docstr_tok: ["Generate","CMakeList","file","from","template","."]
code: def _populate_cmake(
      self,
      cmakefile_template_path: pathlib.Path,
      cmakefile_path: pathlib.Path,
      memory_size: int,
      verbose: bool,
  ):
      """Generate CMakeList file from template."""
  
      regex = re.compile(r"([A-Z_]+) := (<[A-Z_]+>)")
      with open(cmakefile_path, "w") as cmakefile_f:
          with open(
              cmakefile_template_path, "r"
          ) as cmakefile_template_f:
              for line in cmakefile_template_f:
                  cmakefile_f.write(line)
              cmakefile_f.write(
                  f"target_compile_definitions(main PUBLIC -DTVM_WORKSPACE_SIZE_BYTES={memory_size})\n"
              )
              if verbose:
                  cmakefile_f.write(
                      f"set(CMAKE_VERBOSE_MAKEFILE TRUE)\n"
                  )
  
imports: import fcntl
  import os
  import os.path
  import pathlib
  import select
  import shutil
  import subprocess
  import tarfile
  import time
  import re
  from tvm.micro.project_api import server
label_desc: Use image node_id 3 for calling the Handler obj's underlying member method code with example usage: obj._populate_cmake(cmakefile_template_path, cmakefile_path, memory_size, verbose) without return types