]> Creatis software - gdcm.git/blobdiff - setup.py
ENH: update dvpt version
[gdcm.git] / setup.py
index bb77e5a9517c41734a1907e92ece5ec57438b77b..12cb72d483c0fa42374419adc2aa7d6fb8f0a262 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -4,15 +4,17 @@ from distutilsWrapping import *
 from WrapSwig import *
 from WrapVTK import *
 
-ThisModule='gdcmPython'
+ThisModule      ="gdcmPython"
 gdcmPythonSrcDir=ThisModule
 gdcmSrcDir      ="src"
-gdcmJpeg8SrcDir  =os.path.join('src', 'jpeg', 'libijg8')
+gdcmJpeg8SrcDir =os.path.join('src', 'jpeg', 'libijg8')
+gdcmJpeg12SrcDir=os.path.join('src', 'jpeg', 'libijg12')
+gdcmJpgSrcDir   =os.path.join('src', 'jpeg', 'ljpg')
 gdcmvtkSrcDir   ="vtk"
 gdcmDictsDir    ="Dicts"
 gdcmTestDir     ="Test"
 
-# Due to a disutil oddity on Unices : see
+# Due to a distutils oddity on Unices : see
 # http://aspn.activestate.com/ASPN/Mail/Message/distutils-sig/588325
 if(os.name=='posix'):
        targetDir=os.path.join('lib','python'+sys.version[:3],'site-packages')
@@ -32,7 +34,7 @@ else:
                err=str(e)
                print "Environment variable",err[err.rfind(':')+1:],'not defined, '\
                       'please fix it!'
-               VTKPATH="c:\\Creatis\\vtkDistrib"
+               VTKPATH="/usr"
        vtkWrapper=os.path.join(VTKPATH,"bin","vtkWrapPython")
 
 targetDir=os.path.join(targetDir, ThisModule)
@@ -52,7 +54,7 @@ Jpeg8Sources = glob.glob(os.path.join(gdcmJpeg8SrcDir,"j*.c"))
 Jpeg8SourcesToRemove = ['jmemansi.c', 'jmemname.c', 'jmemdos.c', 'jmemmac.c']
 for Remove in Jpeg8SourcesToRemove:
    ### Because setup.py is a multiple pass process we need to trap
-   ### the case were the files were allready wed out on a previous pass.
+   ### the case where the files were already wed out on a previous pass.
    try:
       Jpeg8Sources.remove(os.path.join(gdcmJpeg8SrcDir, Remove))
    except ValueError:
@@ -63,46 +65,53 @@ Jpeg12Sources = glob.glob(os.path.join(gdcmJpeg12SrcDir,"j*.c"))
 Jpeg12SourcesToRemove = ['jmemansi12.c', 'jmemname12.c', 'jmemdos12.c', 'jmemmac12.c']
 for Remove in Jpeg12SourcesToRemove:
    ### Because setup.py is a multiple pass process we need to trap
-   ### the case were the files were allready wed out on a previous pass.
+   ### the case where the files were already wed out on a previous pass.
    try:
       Jpeg12Sources.remove(os.path.join(gdcmJpeg12SrcDir, Remove))
    except ValueError:
       continue
 Sources.extend(Jpeg12Sources)
 
+#For 'xmedcon' Jpeg Lossless
+JpgSources =glob.glob(os.path.join(gdcmJpgSrcDir,"*.c"))
+Sources.extend(JpgSources)  
+
 # Sources 2/ The second extension contains the VTK classes (which we wrap
 #            with the vtk wrappers):
 VTK_INCLUDE_DIR=os.path.join(VTKPATH,"include","vtk")
 VTK_LIB_DIR=os.path.join(VTKPATH,"lib","vtk")
 vtkSources = []
-vtkSources.extend(glob.glob(os.path.join(gdcmvtkSrcDir,"vtk*.cxx")))
-vtkSources.extend(glob.glob(os.path.join(gdcmSrcDir,"*.cxx")))
+vtkSources.extend(glob.glob(os.path.join(gdcmvtkSrcDir,'vtk*.cxx')))
+vtkSources.extend(glob.glob(os.path.join(gdcmSrcDir,'*.cxx')))
 vtkSources.extend(Jpeg8Sources)
-vtkSources.extend(Jpeg12ources)
+vtkSources.extend(Jpeg12Sources)
+vtkSources.extend(JpgSources)
+
 vtkLibraries=["vtkCommon","vtkCommonPython",
               "vtkIO","vtkIOPython",
               "vtkFiltering","vtkFilteringPython"]
 
 ##### 
 setup(name=ThisModule,
-      version="0.3",
+      version="0.4",
       description="...",
       author="frog",
       author_email="frog@creatis.insa-lyon.fr",
-      url="http://www.creatis.insa-lyon.fr/",
+      url="http://www.creatis.insa-lyon.fr/Public/Gdcm/",
       packages=[ '.',
                  gdcmPythonSrcDir,
                  gdcmPythonSrcDir + '.demo' ],
       cmdclass={'build_ext':build_extWrap}, # redirects default build_ext
       ext_modules=[SwigExtension(name='_gdcm',
                                  sources=Sources,
-                                 include_dirs=[gdcmSrcDir,gdcmJpeg8SrcDir],[gdcmSrcDir,gdcmJpeg12SrcDir],
+                                 include_dirs=[gdcmSrcDir,gdcmJpeg8SrcDir,
+                                               gdcmJpeg12SrcDir,gdcmJpgSrcDir],
                                  libraries=libraries,
                                  define_macros=macros,
                                  swig_cpp=1,
                                  swig_include=[gdcmSrcDir]
                                 ),
-                   VTKExtension(name='gdcmPython.vtkgdcmPython',
+                                VTKExtension(name='gdcmPython.vtkgdcmPython',
                                 sources=vtkSources,
                                 include_dirs=[gdcmSrcDir,gdcmvtkSrcDir,
                                               VTK_INCLUDE_DIR],