def build_nt(self): os.chdir(self.build_dir) # do check for some file if os.path.exists(os.path.join("dcmdata/libsrc", BUILD_TARGET, "dcmdata.lib")): utils.output("dcmtk::dcmdata already built. Skipping.") else: # Release buildtype (vs RelWithDebInfo) so we build with # /MD and not /MDd ret = utils.make_command("dcmtk.sln", install=False, project="dcmdata", win_buildtype=BUILD_TARGET) if ret != 0: utils.error("Could not build dcmtk::dcmdata.") if os.path.exists(os.path.join("ofstd/libsrc", BUILD_TARGET, "ofstd.lib")): utils.output("dcmtk::ofstd already built. Skipping.") else: # Release buildtype (vs RelWithDebInfo) so we build with # /MD and not /MDd ret = utils.make_command("dcmtk.sln", install=False, project="ofstd", win_buildtype=BUILD_TARGET) if ret != 0: utils.error("Could not build dcmtk::ofstd.")
def build_nt(self): os.chdir(self.build_dir) # do check for some file if os.path.exists( os.path.join('dcmdata/libsrc', BUILD_TARGET, 'dcmdata.lib')): utils.output('dcmtk::dcmdata already built. Skipping.') else: # Release buildtype (vs RelWithDebInfo) so we build with # /MD and not /MDd ret = utils.make_command('dcmtk.sln', install=False, project='dcmdata', win_buildtype=BUILD_TARGET) if ret != 0: utils.error('Could not build dcmtk::dcmdata.') if os.path.exists( os.path.join('ofstd/libsrc', BUILD_TARGET, 'ofstd.lib')): utils.output('dcmtk::ofstd already built. Skipping.') else: # Release buildtype (vs RelWithDebInfo) so we build with # /MD and not /MDd ret = utils.make_command('dcmtk.sln', install=False, project='ofstd', win_buildtype=BUILD_TARGET) if ret != 0: utils.error('Could not build dcmtk::ofstd.')
def install(self): posix_file = os.path.join(self.inst_dir, 'bin/vtkpython') nt_file = os.path.join(self.inst_dir, 'bin', 'vtkpython.exe') if utils.file_exists(posix_file, nt_file): utils.output("VTK already installed. Skipping build step.") else: # python 2.5.2 setup.py complains that this does not exist # with VTK PV-3-2-1. This is only on installations with # EasyInstall / Python Eggs, then the VTK setup.py uses # EasyInstall and not standard distutils. gah! if not os.path.exists(config.VTK_PYTHON): os.makedirs(config.VTK_PYTHON) os.chdir(self.build_dir) # we save, set and restore the PP env variable, else # stupid setuptools complains save_env = os.environ.get('PYTHONPATH', '') os.environ['PYTHONPATH'] = config.VTK_PYTHON ret = utils.make_command('VTK.sln', install=True) os.environ['PYTHONPATH'] = save_env if ret != 0: utils.error("Could not install VTK. Fix and try again.")
def install(self): config.WRAPITK_TOPLEVEL = self.inst_dir # this dir contains the WrapITK cmake config (WrapITKConfig.cmake) config.WRAPITK_DIR = os.path.join( self.inst_dir, 'lib', 'InsightToolkit', 'WrapITK') # contains all WrapITK shared objects / libraries config.WRAPITK_LIB = os.path.join(config.WRAPITK_DIR, 'lib') # contains itk.py config.WRAPITK_PYTHON = os.path.join(config.WRAPITK_DIR, 'Python') # subsequent wrapitk components will need this config.WRAPITK_SOURCE_DIR = self.source_dir posix_file = os.path.join( config.WRAPITK_LIB, '_RegistrationPython.so') nt_file = os.path.join( config.WRAPITK_LIB, '_RegistrationPython' + config.PYE_EXT) if utils.file_exists(posix_file, nt_file): utils.output("WrapITK already installed, skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('WrapITK.sln', install=True) if ret != 0: utils.error( "Could not install WrapITK. Fix and try again.")
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'vtkTeem' + config.PYE_EXT)): utils.output("vtkTeem already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('vtkTeem.sln', install=True) if ret != 0: utils.error("Could not install vtkTeem. Fix and try again.") else: #There is a problem that the .dll is actually a .pyd but not recognized as such by DeVIDE. Rename. if sys.platform == 'win32': old_name = os.path.join(self.inst_dir, 'bin', 'vtkTeem' + config.SO_EXT) new_name = os.path.join(self.inst_dir, 'bin', 'vtkTeem' + config.PYE_EXT) if os.path.isfile(old_name) and (old_name != new_name): utils.output("Renaming %s%s library to %s%s" % (BASENAME, config.SO_EXT, BASENAME, config.PYE_EXT)) os.rename(old_name, new_name)
def _clone(args): path = args.project logging.info('Create project in %s ...', path) if not os.path.exists(path): logging.info('Make project directory %s', path) os.makedirs(path) src = os.path.abspath(args.src) logging.info('Python scripts base path: %s', src) logging.info('Clone project from path: %s', args.clone) for s in (config_filename, capsule_filename): logging.info('\tCopy file "%s"', s) shutil.copy(os.path.join(args.clone, s), os.path.join(path, s)) logging.info('Init project settings') project = Project() project.open(path) name = os.path.basename(os.path.abspath(path)) project._update(dict(name=name, title=name, src=src, entry=args.entry)) project.save(path) if args.type != 'auto': logging.info('Option --type is ignored when --clone is specified') logging.info('Create pyarmor command ...') script = make_command(plat_name, sys.executable, sys.argv[0], path) logging.info('Pyarmor command %s created', script) logging.info('Project init successfully.')
def _init(args): '''Create an empty project or reinitialize an existing one EXAMPLES pyarmor init --src=examples/simple --entry=queens.py project1 ''' if args.clone: logging.info( 'Warning: option --clone is deprecated, use --capsule instead ') _clone(args) return path = args.project logging.info('Create project in %s ...', path) if not os.path.exists(path): logging.info('Make project directory %s', path) os.makedirs(path) src = os.path.abspath(args.src) logging.info('Python scripts base path: %s', src) name = os.path.basename(os.path.abspath(path)) if (args.type == 'pkg') or \ (args.type == 'auto' and os.path.exists(os.path.join(src, '__init__.py'))): logging.info('Project is configured as package') project = Project(name=name, title=name, src=src, entry=args.entry if args.entry else '__init__.py', is_package=1, obf_code_mode='wrap') else: logging.info('Project is configured as standalone application.') project = Project(name=name, title=name, src=src, entry=args.entry) if args.capsule: capsule = os.path.abspath(args.capsule) logging.info('Share capsule with %s', capsule) project._update(dict(capsule=capsule)) else: logging.info('Create project capsule ...') filename = os.path.join(path, capsule_filename) make_capsule(filename) logging.info('Project capsule %s created', filename) logging.info('Create configure file ...') filename = os.path.join(path, config_filename) project.save(path) logging.info('Configure file %s created', filename) logging.info('Create pyarmor command ...') script = make_command(plat_name, sys.executable, sys.argv[0], path) logging.info('Pyarmor command %s created', script) logging.info('Project init successfully.')
def build(self): # Do not check for existance of self.build_dir. # Visual Studio will only build if out-of-date. os.chdir(self.build_dir) ret = utils.make_command('elastix.sln') if ret != 0: utils.error("Could not build %s. Fix and try again." % BASENAME)
def _init(args): '''Create an empty project or reinitialize an existing one This command creates an empty project in the specified path - basically a configure file .pyarmor_config, a project capsule .pyarmor_capsule.zip, and a shell script "pyarmor" will be created (in windows, it called "pyarmor.bat"). Option --src specifies where to find python source files. By default, all .py files in this directory will be included in this project. Option --entry specifies main script, which could be run directly after obfuscated. Option --clone specifies another project path. It it is set, no new project capsule is generated, just copy capsule from this project. EXAMPLES python pyarmor.py init --src=examples --entry=queens.py project1 cd project1/ ./pyarmor info ''' if args.clone: _clone(args) return path = args.project logging.info('Create project in %s ...', path) if not os.path.exists(path): logging.info('Make project directory %s', path) os.makedirs(path) src = os.path.abspath(args.src) logging.info('Python scripts base path: %s', src) name = os.path.basename(os.path.abspath(path)) project = Project(name=name, title=name, src=src, entry=args.entry) logging.info('Create configure file ...') filename = os.path.join(path, config_filename) project.save(path) logging.info('Configure file %s created', filename) logging.info('Create project capsule ...') filename = os.path.join(path, capsule_filename) make_capsule(filename) logging.info('Project capsule %s created', filename) logging.info('Create pyarmor command ...') script = make_command(plat_name, sys.executable, sys.argv[0], path) logging.info('Pyarmor command %s created', script) logging.info('Project init successfully.')
def install(self): if os.path.exists(self.inst_dir): utils.output("%s already installed, skipping step." % BASENAME) return os.chdir(self.build_dir) ret = utils.make_command('elastix.sln', install=True) if ret != 0: utils.error("Could not install %s. Fix and try again." % BASENAME)
def build(self): if os.name == 'posix': os.chdir(self.build_dir) if os.path.exists('swig'): utils.output('SWIG already built. Skipping step.') return ret = utils.make_command(None) if ret != 0: utils.error("Could not build SWIG. Fix and try again.")
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'unu' + config.EXE_EXT)): utils.output("teem already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('teem.sln', install=True) if ret != 0: utils.error("Could not install teem. Fix and try again.")
def install(self): if os.path.exists(self.inst_dir): utils.output("%s already installed, skipping step." % BASENAME) return os.chdir(self.build_dir) ret = utils.make_command('elastix.sln', install=True) if ret != 0: utils.error( "Could not install %s. Fix and try again." % BASENAME)
def install(self): posix_file = os.path.join(self.inst_dir, 'bin/ErGUI') nt_file = os.path.join(self.inst_dir, 'bin', 'ErGUI.exe') if utils.file_exists(posix_file, nt_file): utils.output("Template Workbench already installed. Skipping install step.") else: ret = utils.make_command('ErGUI.sln', install=True) if ret != 0: utils.error("Could not install Template Workbench. Fix and try again.")
def install(self): # config.WRAPITK_LIB is something like: # /inst/Insight/lib/InsightToolkit/WrapITK/lib if os.path.exists(os.path.join(config.WRAPITK_LIB, "_ItkVtkGluePython" + config.PYE_EXT)): utils.output("ItkVtkGlue already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command("ItkVtkGlue.sln", install=True) if ret != 0: utils.error("Could not install ItkVtkGlue. Fix and try again.")
def build(self): bin_path = os.path.join(self.build_dir, 'apps', 'tighten', 'RelWithDebInfo') if utils.file_exists(bin_path, bin_path): utils.output("%s already built. Skipping build step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('VispackMorphsmooth.sln') if ret != 0: utils.error("Could not build %s. Fix and try again." % BASENAME)
def build(self): bin_path = os.path.join(self.build_dir, 'bin') if utils.file_exists(bin_path, bin_path): utils.output("teem already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('teem.sln') if ret != 0: utils.error("Could not build teem. Fix and try again.")
def install(self): if os.path.exists( os.path.join(config.WRAPITK_LIB, '_itktudossPython' + config.PYE_EXT)): utils.output("itktudoss already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('itktudoss.sln', install=True) if ret != 0: utils.error("Could not install itktudoss. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, "lib/_ItkVtkGluePython.so") nt_file = os.path.join(self.build_dir, "lib", config.BUILD_TARGET, "_ItkVtkGluePython" + config.PYE_EXT) if utils.file_exists(posix_file, nt_file): utils.output("ItkVtkGlue already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command("ItkVtkGlue.sln") if ret != 0: utils.error("Could not build ItkVtkGlue. Fix and try again.")
def build(self): bin_path = os.path.join(self.build_dir,'src','multisurfaces','run-particle-system','optimize-particle-system.dir') if utils.file_exists(bin_path, bin_path): utils.output("%s already built. Skipping build step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('Project.sln') if ret != 0: utils.error("Could not build %s. Fix and try again." % BASENAME)
def build(self): nt_file = os.path.join(self.build_dir, 'vtkTeemInit.cxx') if utils.file_exists(nt_file, nt_file): utils.output("vtkTeem already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('vtkTeem.sln') if ret != 0: utils.error("Could not build vtkTeem. Fix and try againn.")
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'morphsmooth' + config.EXE_EXT)): utils.output("%s already installed. Skipping step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('VispackMorphsmooth.sln', install=True) if ret != 0: utils.error("Could not install %s. Fix and try again." % BASENAME)
def build(self): posix_file = os.path.join(self.build_dir, 'bin/libvtkWidgetsPython.so') nt_file = os.path.join(self.build_dir, 'bin', config.BUILD_TARGET, 'vtkWidgetsPythonD.dll') if utils.file_exists(posix_file, nt_file): utils.output("VTK already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('VTK.sln') if ret != 0: utils.error("Error building VTK. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, "bin/libvtkgdcmPython.so") nt_file = os.path.join(self.build_dir, "bin", config.BUILD_TARGET, "vtkgdcmPythonD.dll") if utils.file_exists(posix_file, nt_file): utils.output("GDCM already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command("GDCM.sln") if ret != 0: utils.error("Could not build GDCM. Fix and try again.")
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'optimize-particle-system' + config.EXE_EXT)): utils.output("%s already installed. Skipping step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('Project.sln', install=True) if ret != 0: utils.error("Could not install %s. Fix and try again." % BASENAME)
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'optimize-particle-system' + config.EXE_EXT)): utils.output("%s already installed. Skipping step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('Project.sln', install=True) if ret != 0: utils.error( "Could not install %s. Fix and try again." % BASENAME)
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'morphsmooth' + config.EXE_EXT)): utils.output("%s already installed. Skipping step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('VispackMorphsmooth.sln', install=True) if ret != 0: utils.error( "Could not install %s. Fix and try again." % BASENAME)
def install(self): if os.path.exists( os.path.join(self.inst_dir, 'bin', 'ima3d' + config.EXE_EXT)): utils.output("vtkTeem already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('IMA3d.sln', install=True) if ret != 0: utils.error( "Could not install %s. Fix and try again." % BASENAME)
def build(self): posix_file = os.path.join(self.build_dir, 'bin', 'cswig') nt_file = os.path.join(self.build_dir, 'bin', config.BUILD_TARGET, 'cswig.exe') if utils.file_exists(posix_file, nt_file): utils.output("CableSwig already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('CableSwig.sln') if ret != 0: utils.error("Error building CableSwig. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir,'bin','RelWithDebInfo','volume.o') nt_file = os.path.join(self.build_dir,'bin','RelWithDebInfo','volume.lib') if utils.file_exists(posix_file, nt_file): utils.output("%s already built. Skipping build step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('%s.sln' % BASENAME) if ret != 0: utils.error("Could not build %s. Fix and try again." % BASENAME)
def install(self): if os.path.exists( os.path.join(config.WRAPITK_LIB, '_itktudossPython' + config.PYE_EXT)): utils.output("itktudoss already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('itktudoss.sln', install=True) if ret != 0: utils.error( "Could not install itktudoss. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, 'lib/_ItkVtkGluePython.so') nt_file = os.path.join(self.build_dir, 'lib', config.BUILD_TARGET, '_ItkVtkGluePython' + config.PYE_EXT) if utils.file_exists(posix_file, nt_file): utils.output("ItkVtkGlue already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('ItkVtkGlue.sln') if ret != 0: utils.error("Could not build ItkVtkGlue. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, config.BUILD_TARGET, 'libvtkErCorePython.so') #TODO: check whether this is the correct file to test on nt_file = os.path.join(self.build_dir, config.BUILD_TARGET, 'vtkErCorePythonD.dll') if utils.file_exists(posix_file, nt_file): utils.output("Template Workbench already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('ErGUI.sln') if ret != 0: utils.error("Error building Template Workbench. Fix and try again.")
def _init(args): '''Create an empty project or reinitialize an existing one EXAMPLES pyarmor init --src=examples/simple --entry=queens.py project1 ''' path = args.project logging.info('Create project in %s ...', path) if not os.path.exists(path): logging.info('Make project directory %s', path) os.makedirs(path) src = os.path.abspath(args.src) logging.info('Python scripts base path: %s', src) name = os.path.basename(os.path.abspath(path)) if (args.type == 'pkg') or \ (args.type == 'auto' and os.path.exists(os.path.join(src, '__init__.py'))): logging.info('Project is configured as package') project = Project(name=name, title=name, src=src, entry=args.entry if args.entry else '__init__.py', is_package=1, disable_restrict_mode=1) else: logging.info('Project is configured as standalone application.') project = Project(name=name, title=name, src=src, entry=args.entry) if args.capsule: capsule = os.path.abspath(args.capsule) logging.info('Set project capsule to %s', capsule) else: capsule = os.path.abspath(DEFAULT_CAPSULE) logging.info('Use global capsule as project capsule: %s', capsule) project._update(dict(capsule=capsule)) logging.info('Create configure file ...') filename = os.path.join(path, config_filename) project.save(path) logging.info('Configure file %s created', filename) logging.info('Create pyarmor command ...') script = make_command(plat_name, sys.executable, sys.argv[0], path) logging.info('PyArmor command %s created', script) logging.info('Project init successfully.')
def install(self): posix_file = os.path.join(self.inst_dir, 'bin/vtkpython') nt_file = os.path.join(self.inst_dir, 'bin', 'vtkpython.exe') if utils.file_exists(posix_file, nt_file): utils.output("VTK already installed. Skipping build step.") else: # python 2.5.2 setup.py complains that this does not exist # with VTK PV-3-2-1. This is only on installations with # EasyInstall / Python Eggs, then the VTK setup.py uses # EasyInstall and not standard distutils. gah! # just tested with VTK 5.8.0 and Python 2.7.2 # it indeed installs VTK_PYTHON/VTK-5.8.0-py2.7.egg # but due to the site.py and easy-install.pth magic in there, # adding VTK_PYTHON to the PYTHONPATH still works. We can keep # pip, yay! if not os.path.exists(config.VTK_PYTHON): os.makedirs(config.VTK_PYTHON) os.chdir(self.build_dir) # we save, set and restore the PP env variable, else # stupid setuptools complains save_env = os.environ.get('PYTHONPATH', '') os.environ['PYTHONPATH'] = config.VTK_PYTHON ret = utils.make_command('VTK.sln', install=True) os.environ['PYTHONPATH'] = save_env if ret != 0: utils.error("Could not install VTK. Fix and try again.") # now do some surgery on VTKConfig.cmake and # VTKLibraryDepends.cmake so builds of VTK-dependent libraries # with only the DRE to link with Just Work(tm) # on windows, we need to replace backslash with forward slash # as that's the style used by the config files. On *ix mostly # harmless idp = re.sub(r'\\', '/', config.inst_dir) for fn in [ os.path.join(config.VTK_DIR, 'VTKConfig.cmake'), os.path.join(config.VTK_DIR, 'VTKLibraryDepends.cmake'), os.path.join(config.VTK_DIR, 'VTKTargets-relwithdebinfo.cmake') ]: if os.path.exists(fn): utils.re_sub_filter_file( [(idp, '${VTK_INSTALL_PREFIX}/..')], fn)
def install(self): config.VTKDEVIDE_PYTHON = os.path.join(self.inst_dir, 'lib') config.VTKDEVIDE_LIB = os.path.join(self.inst_dir, 'lib') test_file = os.path.join(config.VTKDEVIDE_LIB, 'vtkdevide.py') if os.path.exists(test_file): utils.output("vtkdevide already installed, skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('VTKDEVIDE.sln', install=True) if ret != 0: utils.error("Could not install vtkdevide. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, 'bin/libvtkdevideExternalPython.so') nt_file = os.path.join(self.build_dir, 'bin', config.BUILD_TARGET, 'vtkdevideExternalPython' + config.PYE_EXT) if utils.file_exists(posix_file, nt_file): utils.output("vtkdevide already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('VTKDEVIDE.sln') if ret != 0: utils.error("Could not build vtkdevide. Fix and try again.")
def build(self): posix_file = os.path.join( self.build_dir, 'bin', 'cswig') nt_file = os.path.join( self.build_dir, 'bin', config.BUILD_TARGET, 'cswig.exe') if utils.file_exists(posix_file, nt_file): utils.output("CableSwig already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('CableSwig.sln') if ret != 0: utils.error("Error building CableSwig. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, 'bin/libvtktudossGraphicsPython.so') nt_file = os.path.join(self.build_dir, 'bin', config.BUILD_TARGET, 'vtktudossGraphicsPythonD.dll') if utils.file_exists(posix_file, nt_file): utils.output("vtktudoss already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('VTKTUDOSS.sln') if ret != 0: utils.error("Could not build vtktudoss. Fix and try again.")
def install(self): nt_file = os.path.join(config.ITK_BIN, 'ITKCommon.dll') posix_file = os.path.join(config.ITK_DIR, 'libITKCommon.so') if utils.file_exists(posix_file, nt_file): utils.output("ITK already installed. Skipping step.") else: os.chdir(self.build_dir) # really sad, ITK 3.4 on Windows rebuilds the whole ITK # when I request an INSTALL ret = utils.make_command('ITK.sln', install=True) if ret != 0: utils.error("Could not install ITK. Fix and try again.")
def install(self): # config.WRAPITK_LIB is something like: # /inst/Insight/lib/InsightToolkit/WrapITK/lib if os.path.exists( os.path.join(config.WRAPITK_LIB, '_ItkVtkGluePython' + config.PYE_EXT)): utils.output("ItkVtkGlue already installed. Skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('ItkVtkGlue.sln', install=True) if ret != 0: utils.error( "Could not install ItkVtkGlue. Fix and try again.")
def build(self): bin_path = os.path.join(self.build_dir, 'src', 'multisurfaces', 'run-particle-system', 'optimize-particle-system.dir') if utils.file_exists(bin_path, bin_path): utils.output("%s already built. Skipping build step." % BASENAME) else: os.chdir(self.build_dir) ret = utils.make_command('Project.sln') if ret != 0: utils.error("Could not build %s. Fix and try again." % BASENAME)
def install(self): posix_file = os.path.join(self.inst_dir, 'bin/vtkpython') nt_file = os.path.join(self.inst_dir, 'bin', 'vtkpython.exe') if utils.file_exists(posix_file, nt_file): utils.output("VTK already installed. Skipping build step.") else: # python 2.5.2 setup.py complains that this does not exist # with VTK PV-3-2-1. This is only on installations with # EasyInstall / Python Eggs, then the VTK setup.py uses # EasyInstall and not standard distutils. gah! # just tested with VTK 5.8.0 and Python 2.7.2 # it indeed installs VTK_PYTHON/VTK-5.8.0-py2.7.egg # but due to the site.py and easy-install.pth magic in there, # adding VTK_PYTHON to the PYTHONPATH still works. We can keep # pip, yay! if not os.path.exists(config.VTK_PYTHON): os.makedirs(config.VTK_PYTHON) os.chdir(self.build_dir) # we save, set and restore the PP env variable, else # stupid setuptools complains save_env = os.environ.get('PYTHONPATH', '') os.environ['PYTHONPATH'] = config.VTK_PYTHON ret = utils.make_command('VTK.sln', install=True) os.environ['PYTHONPATH'] = save_env if ret != 0: utils.error("Could not install VTK. Fix and try again.") # now do some surgery on VTKConfig.cmake and # VTKLibraryDepends.cmake so builds of VTK-dependent libraries # with only the DRE to link with Just Work(tm) # on windows, we need to replace backslash with forward slash # as that's the style used by the config files. On *ix mostly # harmless idp = re.sub(r'\\','/', config.inst_dir) for fn in [os.path.join(config.VTK_DIR, 'VTKConfig.cmake'), os.path.join(config.VTK_DIR, 'VTKLibraryDepends.cmake'), os.path.join(config.VTK_DIR, 'VTKTargets-relwithdebinfo.cmake')]: if os.path.exists(fn): utils.re_sub_filter_file( [(idp, '${VTK_INSTALL_PREFIX}/..')], fn)
def install(self): config.VTKTUDOSS_PYTHON = os.path.join( self.inst_dir, 'lib') config.VTKTUDOSS_LIB = os.path.join(self.inst_dir, 'lib') test_file = os.path.join(config.VTKTUDOSS_LIB, 'vtktudoss.py') if os.path.exists(test_file): utils.output("vtktudoss already installed, skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command('VTKTUDOSS.sln', install=True) if ret != 0: utils.error( "Could not install vtktudoss. Fix and try again.")
def install(self): nt_file = os.path.join(config.ITK_PYTHON, 'ITKCommonPython.dll') posix_file = os.path.join( config.ITK_PYTHON, '_ITKCommonPython.so') if utils.file_exists(posix_file, nt_file): utils.output("ITK already installed. Skipping step.") else: os.chdir(self.build_dir) # really sad, ITK 3.4 on Windows rebuilds the whole ITK # when I request an INSTALL ret = utils.make_command('ITK.sln', install=True) if ret != 0: utils.error("Could not install ITK. Fix and try again.")
def build(self): posix_file = os.path.join(self.build_dir, 'lib/_itktudossPython.so') nt_file = os.path.join(self.build_dir, 'lib', config.BUILD_TARGET, '_itktudossPython' + config.PYE_EXT) if utils.file_exists(posix_file, nt_file): utils.output("itktudoss already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('ITKTUDOSS.sln') if ret != 0: utils.error("Could not build itktudoss. Fix and try again.")
def install(self): if os.name == "nt": config.GDCM_LIB = os.path.join(self.inst_dir, "bin") else: config.GDCM_LIB = os.path.join(self.inst_dir, "lib") config.GDCM_PYTHON = os.path.join(self.inst_dir, "lib") test_file = os.path.join(config.GDCM_PYTHON, "gdcm.py") if os.path.exists(test_file): utils.output("gdcm already installed, skipping step.") else: os.chdir(self.build_dir) ret = utils.make_command("GDCM.sln", install=True) if ret != 0: utils.error("Could not install gdcm. Fix and try again.")
def build(self): # ITK 4.0 style! posix_file = os.path.join(self.build_dir, 'lib', '_ITKCommonPython.so') nt_file = os.path.join(self.build_dir, 'bin', config.BUILD_TARGET, 'ITKCommon.dll') if utils.file_exists(posix_file, nt_file): utils.output("ITK already built. Skipping build step.") else: os.chdir(self.build_dir) ret = utils.make_command('ITK.sln') if ret != 0: utils.error("Error building ITK. Fix and try again.")