code: def cmds_cmake(
      target: str | tuple[str, ...] | list[str],
      *params,
      build_dir: str = ".",
  ) -> list[str]:
      if not isinstance(target, str):
          target = " ".join(target)
  
      return [
          " ".join(
              [
                  "{cmake}",
                  "-DCMAKE_BUILD_TYPE=Release",
                  "-DCMAKE_VERBOSE_MAKEFILE=ON",
                  "-DCMAKE_RULE_MESSAGES:BOOL=OFF",  # for NMake
                  "-DCMAKE_C_COMPILER=cl.exe",  # for Ninja
                  "-DCMAKE_CXX_COMPILER=cl.exe",  # for Ninja
                  "-DCMAKE_C_FLAGS=-nologo",
                  "-DCMAKE_CXX_FLAGS=-nologo",
                  *params,
                  '-G "{cmake_generator}"',
                  f'-B "{build_dir}"',
                  "-S .",
              ]
          ),
          f'{{cmake}} --build "{build_dir}" --clean-first --parallel --target {target}',
      ]
  
imports: from __future__ import annotations
  import argparse
  import os
  import platform
  import re
  import shutil
  import struct
  import subprocess
label_desc: Use image node_id 9 for calling a global function with example usage: cmds_cmake(target) and returns: list