code: def build_extension(self, ext):
      self.announce(
          "Building for package: {}".format(ext.package_name), log.INFO
      )
      self.announce("Building extension: {}".format(ext.name), log.INFO)
  
      build_temp = pathlib.Path(self.build_temp)
      build_temp.mkdir(parents=True, exist_ok=True)
      extdir = pathlib.Path(
          self.get_ext_fullpath(ext.name)
      ).parent.absolute()
      extdir.mkdir(parents=True, exist_ok=True)
      #  I prefer to place the libraries in a "libs" subdir in the package
      liboutputdir = extdir.joinpath(ext.package_name, "libs")
      liboutputdir.mkdir(parents=True, exist_ok=True)
  
      cmake_args = [
          "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(liboutputdir),
          "-DPYTHON_EXECUTABLE={}".format(sys.executable),
      ]
  
      cfg = "Debug" if self.debug else "Release"
      self.announce("CMake configuration: {}".format(cfg), log.INFO)
      build_args = ["--config", cfg]
  
      # Also limit Windows to single config build -
      # Causes Conan to load a single set of libs
      cmake_args += [
          "-DCMAKE_BUILD_TYPE=" + cfg,
          "-DTEMP_LIBS_DIR=" + ext.templibdir,
      ]
      if platform.system() == "Windows":
          # VS can produce separate RELEASE or DEBUG outputs
          cmake_args += [
              "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}".format(
                  cfg.upper(), liboutputdir
              )
          ]
          if sys.maxsize > 2**32:
              cmake_args += ["-A", "x64"]
          build_args += ["--", "/m"]
      elif platform.system() == "Linux":
          build_args += ["--", "-j3"]
      elif platform.system() == "Darwin":
          # Xcode automatically optimizes core usage
          # as default Xcode will create a release subdir
          cmake_args += [
              "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}".format(
                  cfg.upper(), liboutputdir
              )
          ]
          build_args += ["--"]
      else:
          raise RuntimeError("Unsupported platform")
  
      # Building with conan
      cmake_args += ["-DNPTSNE_BUILD_WITH_CONAN=ON"]
  
      env = os.environ.copy()
      env["CXXFLAGS"] = '{} -DVERSION_INFO=\\"{}\\"'.format(
          env.get("CXXFLAGS", ""), self.distribution.get_version()
      )
      self.announce(
          "CXXFLAGS: {}".format(self.distribution.get_version()),
          log.INFO,
      )
  
      # CMake configure
      subprocess.check_call(
          ["cmake", ext.sourcedir] + cmake_args,
          cwd=self.build_temp,
          env=env,
      )
      # CMake build
      subprocess.check_call(
          ["cmake", "--build", ".", "--verbose"] + build_args,
          cwd=self.build_temp,
      )
  
      # get the dependent libs (were supplied by Conan)
      # os.environ['LD_LIBRARY_PATH'] = liboutputdir
  
      print("Move the conan dependencies for wheel fix-up")
      subprocess.check_call(
          [
              "cmake",
              "--build",
              ".",
              "--target",
              "bundle_libs",
              "--config",
              cfg,
          ],
          cwd=self.build_temp,
      )
  
      print("Files in output dir: ", os.listdir(liboutputdir))
      print("Files in temp libs dir: ", os.listdir(ext.templibdir))
      print("LD_LIBRARY_PATH: ", os.environ.get("LD_LIBRARY_PATH", ""))
  
imports: import glob
  import json
  import os
  import pathlib
  import platform
  import re
  import shutil
  import sys
  import tempfile
  import tempfile
  import time
  import subprocess
  import urllib, urllib.request
  from setuptools import Extension
  from setuptools.command.build_ext import build_ext
  from distutils.version import LooseVersion
  from distutils.file_util import copy_file
  from distutils import log
  from pathlib import Path
label_desc: Use image node_id 2 for calling the CMakeBuild obj's underlying member method code with example usage: obj.build_extension(ext) without return types