class_docstr: CMakeBuild represents a build directory initialized by cmake.
  
  The build instance can be used to build/test/install. It alleviates the
  user to know which generator is used.
docstr: Initialize a CMakeBuild.
  
  The caller must ensure that cmake was invoked in the build directory.
  
  Parameters
  ----------
  definition : CMakeDefinition
               The definition to build from.
  build_dir : str
              The build directory to setup into.
docstr_tok: ["Initialize","a","CMakeBuild",".","The","caller","must","ensure","that","cmake","was","invoked","in","the","build","directory",".","Parameters","--","--","--","--","--","definition",":","CMakeDefinition","The","definition","to","build","from",".","build_dir",":","str","The","build","directory","to","setup","into","."]
code: def __init__(self, build_dir, build_type, definition=None):
      """Initialize a CMakeBuild.
  
      The caller must ensure that cmake was invoked in the build directory.
  
      Parameters
      ----------
      definition : CMakeDefinition
                   The definition to build from.
      build_dir : str
                  The build directory to setup into.
      """
      assert CMakeBuild.is_build_dir(build_dir)
      super().__init__()
      self.build_dir = os.path.abspath(build_dir)
      self.build_type = build_type
      self.definition = definition
  
imports: import os
  import re
  from shutil import rmtree, which
  from .command import Command, default_bin
label_desc: Use image node_id 1 to create a new CMakeBuild object from inherited base classes: CMake with example: obj = CMakeBuild(build_dir, build_type, definition)