def METHOD_NAME(cmd):
    def IsExe(fpath):
        return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
    # Set the command we are looking for
    if IsWindows():
        cmdexe = 'gfxrecon-' + cmd + '.exe'
    else:
        cmdexe = 'gfxrecon-' + cmd
    # Search for cmdexe in current dir
    if IsExe(cmdexe):
        return [os.path.join('.', cmdexe)]
    # Search for cmdexe in PATH
    for path in os.environ['PATH'].split(os.pathsep):
        c = os.path.join(path, cmdexe)
        if IsExe(c):
            return [c]
    # Windows: Search for cmdexe in <scriptdir>/../cmd/*
    # (<scriptdir> is the dir that this script is located in.)
    scriptdir = os.path.dirname(os.path.realpath(__file__))
    if IsWindows():
       for buildtype in ['Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel']:
            c = os.path.join(scriptdir, '..', cmd, buildtype, cmdexe)
            if IsExe(c):
                return [c]
    else:
        # Linux: Search for cmdexe in <scriptdir>/../cmd
        c = os.path.join(scriptdir, '..', cmd, cmdexe)
        if IsExe(c):
            return [c]
    cmdpy = 'gfxrecon-' + cmd + '.py'
    # Search for cmdpy in current dir
    if os.path.isfile(cmdpy):
        return [sys.executable, cmdpy]
    # Search for cmdpy in PATH
    for path in os.environ['PATH'].split(os.pathsep):
        c=os.path.join(path, cmdpy)
        if os.path.isfile(c):
            return [sys.executable, c]
    # Search for cmdpy <scriptdir>/../cmd
    c = os.path.join(scriptdir, '..', cmd, cmdpy)
    if os.path.isfile(c):
        return [sys.executable, c]
    # Didn't find the executable or py command, error out
    print('Error: Cannot find ' + cmdexe + ' or ' + cmdpy + ' to execute')
    sys.exit(1)