def METHOD_NAME(self,
                     path_to_src=None,
                     generator=None,
                     coverage_output_type=None,
                     debug=False,
                     valgrind=False):
    """
    Create Makefiles and prepare targets with CMake.
    Keyword arguments:
    path_to_src - Path to source directory
    generator - Type of Makefiles to generate
    coverage_output_type - Generate HTML, XML or both reports
    debug - Target debug or release build
    """
    if generator is None:
        generator = DEFAULT_CMAKE_GENERATORS.get(self.make_program,
                                                 "Unix Makefiles")
    cmake = get_cmake_tool()
    if cmake is None:
        logging.error(
            "No CMake found in Path. Install all the required tools.")
        sys.exit(1)
    args = [cmake,
            "-G",
            generator,
            "-DBUILD_TESTING=ON"
            "-DCMAKE_MAKE_PROGRAM=%s" % self.make_program,
            "-DCMAKE_CXX_COMPILER=%s" % get_cxx_tool(),
            "-DCMAKE_C_COMPILER=%s" % get_c_tool()]
    if debug:
        args.append("-DCMAKE_BUILD_TYPE=Debug")
    if coverage_output_type:
        args.append("-DCOVERAGE:STRING=%s" % coverage_output_type)
    if valgrind:
        valgrind = get_valgrind_tool()
        if valgrind is None:
            logging.error(
                "No Valgrind found in Path. Install all the required tools.\n")
            sys.exit(1)
        args.append("-DVALGRIND=1")
        args.append("-DMEMORYCHECK_COMMAND_OPTIONS=\"--track-origins=yes\" \"--leak-check=full\" \"--show-reachable=yes\" \"--error-exitcode=1\"")
    else:
        args.append("-DVALGRIND=0")
    if path_to_src is not None:
        args.append(path_to_src)
    execute_program(args,
                    "CMake failed to run successfully. See error message.")