[PYTHON] Automatische Erkennung des Build-Verzeichnisses in waf

In the build process, bld.cur_script is set as a running script node. We can use bld.cur_script to detect building directory.

bld.cur_script.relpath() # Returns relative path from root waf script

I add handy function to bld object as below.

def build(bld):
  def add_prefix(bld, path):
    return os.path.join(os.path.dirname(bld.cur_script.relpath()), str(path))

  bld.add_prefix = functools.partial(add_prefix, bld)
  bld.recurse('dir1 dir2 ... dir3')

Recommended Posts

Automatische Erkennung des Build-Verzeichnisses in waf
Berechnung der mittleren IoU bei der Objekterkennung
Nachweis von ArUco-Markern
[Hinweis] Import von Dateien in das übergeordnete Verzeichnis in Python
Vergleich der Farberkennungsmethoden in OpenCV inRange, numpy, cupy