def command_tools(): tools = 'tools' tools_bin = 'tools/bin/%s' % TURBULENZOS mkdir(tools_bin) if TURBULENZOS == 'win32': devenv, vs_version = find_devenv() if vs_version == '2008': proj_postfix = '.vcproj' sln_postfix = '.sln' elif vs_version == '2010': proj_postfix = '-2010.vcxproj' sln_postfix = '-2010.sln' elif vs_version == '2012': proj_postfix = '-2012.vcxproj' sln_postfix = '-2012.sln' cgfx2json_proj = os.path.normpath( os.path.join(TURBULENZROOT, tools, 'cgfx2json', 'cgfx2json%s' % proj_postfix)) sh([devenv, cgfx2json_proj, '/build', 'Release'], console=True) cp('tools/cgfx2json/Release/cgfx2json.exe', tools_bin) cp('external/Cg/bin/cg.dll', tools_bin) cp('external/Cg/bin/cgGL.dll', tools_bin) nvtristrip_sln = os.path.normpath( os.path.join(TURBULENZROOT, tools, 'NvTriStrip', 'NvTriStrip%s' % sln_postfix)) sh([devenv, nvtristrip_sln, '/build', 'Release'], console=True) cp('tools/NvTriStrip/NvTriStripper/bin/release/NvTriStripper.exe', tools_bin) else: sh('make', tools, console=True) cp('tools/cgfx2json/bin/release/cgfx2json', tools_bin) cp('tools/NvTriStrip/NvTriStripper/bin/release/NvTriStripper', tools_bin)
def command_tools(): tools = os.path.normpath(os.path.join(TURBULENZROOT, 'tools')) tools_bin = os.path.normpath(os.path.join(tools, 'bin', TURBULENZOS)) mkdir(tools_bin) if TURBULENZOS == 'win32': devenv, vs_version_name, msbuild = find_devenv() if not devenv and not msbuild: error('Could not find a valid install of Visual Studio') return 1 if vs_version_name == '2008': proj_postfix = '.vcproj' sln_postfix = '.sln' vs_version = '9.0' elif vs_version_name == '2010': proj_postfix = '-2010.vcxproj' sln_postfix = '-2010.sln' vs_version = '10.0' elif vs_version_name == '2012': proj_postfix = '-2012.vcxproj' sln_postfix = '-2012.sln' vs_version = '11.0' if devenv: base_cmd = [devenv, '/build', 'Release'] elif msbuild: base_cmd = [msbuild, '/t:build', '/p:Configuration=Release', '/p:Platform=Win32', '/p:VisualStudioVersion=%s' % vs_version] cgfx2json_proj = os.path.join(tools, 'cgfx2json', 'cgfx2json%s' % proj_postfix) cmd = base_cmd + [cgfx2json_proj] sh(cmd, console=True, shell=True) cp('%s/cgfx2json/Release/cgfx2json.exe' % tools, tools_bin) cp('%s/external/Cg/bin/cg.dll' % TURBULENZROOT, tools_bin) cp('%s/external/Cg/bin/cgGL.dll' % TURBULENZROOT, tools_bin) nvtristrip_sln = os.path.join(tools, 'NvTriStrip', 'NvTriStrip%s' % sln_postfix) cmd = base_cmd + [nvtristrip_sln] sh(cmd, console=True, shell=True) cp('%s/NvTriStrip/NvTriStripper/bin/release/NvTriStripper.exe' % tools, tools_bin) else: sh('make', cwd=tools, console=True) cp('%s/cgfx2json/bin/release/cgfx2json' % tools, tools_bin) cp('%s/NvTriStrip/NvTriStripper/bin/release/NvTriStripper' % tools, tools_bin)
def command_tools(): tools = os.path.normpath(os.path.join(TURBULENZROOT, 'tools')) tools_bin = os.path.normpath(os.path.join(tools, 'bin', TURBULENZOS)) mkdir(tools_bin) if TURBULENZOS == 'win32': devenv, vs_version_name, msbuild = find_devenv() if not devenv and not msbuild: error('Could not find a valid install of Visual Studio') return 1 if vs_version_name == '2008': proj_postfix = '.vcproj' sln_postfix = '.sln' vs_version = '9.0' elif vs_version_name == '2010': proj_postfix = '-2010.vcxproj' sln_postfix = '-2010.sln' vs_version = '10.0' elif vs_version_name == '2012': proj_postfix = '-2012.vcxproj' sln_postfix = '-2012.sln' vs_version = '11.0' elif vs_version_name == '2013': proj_postfix = '-2013.vcxproj' sln_postfix = '-2013.sln' vs_version = '12.0' if devenv: base_cmd = [devenv, '/build', 'Release'] elif msbuild: base_cmd = [msbuild, '/t:build', '/p:Configuration=Release', '/p:Platform=Win32', '/p:VisualStudioVersion=%s' % vs_version] cgfx2json_proj = os.path.join(tools, 'cgfx2json', 'cgfx2json%s' % proj_postfix) cmd = base_cmd + [cgfx2json_proj] sh(cmd, console=True, shell=True) cp('%s/cgfx2json/Release/cgfx2json.exe' % tools, tools_bin) cp('%s/external/Cg/bin/cg.dll' % TURBULENZROOT, tools_bin) cp('%s/external/Cg/bin/cgGL.dll' % TURBULENZROOT, tools_bin) nvtristrip_sln = os.path.join(tools, 'NvTriStrip', 'NvTriStrip%s' % sln_postfix) cmd = base_cmd + [nvtristrip_sln] sh(cmd, console=True, shell=True) cp('%s/NvTriStrip/NvTriStripper/bin/release/NvTriStripper.exe' % tools, tools_bin) else: sh('make', cwd=tools, console=True) cp('%s/cgfx2json/bin/release/cgfx2json' % tools, tools_bin) cp('%s/NvTriStrip/NvTriStripper/bin/release/NvTriStripper' % tools, tools_bin)