X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=distutilsWrapping.py;h=e1fbcb09ea937dbdc7ec3f0845bf1b183c0d3152;hb=05a8ef5406eb1d78b0a43a714b41656a297a7f3c;hp=96152a9b55fed4534dfde0dc56985aa4c0554db6;hpb=73dbefbe532057ce77d9f338a4dc093cdce89898;p=gdcm.git diff --git a/distutilsWrapping.py b/distutilsWrapping.py index 96152a9b..e1fbcb09 100644 --- a/distutilsWrapping.py +++ b/distutilsWrapping.py @@ -1,7 +1,9 @@ from distutils.command.build_ext import build_ext from distutils.core import Extension +from distutils.file_util import copy_file from types import ListType import os +import string class build_extWrap(build_ext): """ @@ -16,6 +18,26 @@ class build_extWrap(build_ext): self.__ext=ext build_ext.build_extension(self,ext) + if(os.name!='posix'): + # Copy the .lib file + fullname = self.get_ext_fullname(ext.name) + modpath = string.split(fullname, '.') + package = string.join(modpath[0:-1], '.') + base = modpath[-1] + if self.inplace: + # ignore build-lib -- put the compiled extension into + # the source tree along with pure Python modules + build_py = self.get_finalized_command('build_py') + package_dir = build_py.get_package_dir(package) + dstLib=package_dir + else: + dstLib=self.build_lib + + srcLib=os.path.join(self.build_temp,base+".lib") + dstLib=os.path.join(dstLib,package) + + copy_file(srcLib,dstLib) + def swig_sources(self,sources): """Walk the list of source files in 'sources',looking for SWIG interface(.i) files. Run SWIG on all that are found,and