]> Creatis software - gdcm.git/blobdiff - setup.py
*ENH: Turn it into DOS file type to match libgdcmijpeg8.dsp file type
[gdcm.git] / setup.py
index 54d85df2e4627d48896d87efbf641c4d09550d3a..8dfa2f234dcab7ade6a442cac6d33ade043df2e7 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,8 @@ from WrapVTK import *
 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')
 gdcmvtkSrcDir   ="vtk"
 gdcmDictsDir    ="Dicts"
 gdcmTestDir     ="Test"
@@ -47,6 +48,7 @@ Sources.append(os.path.join(gdcmPythonSrcDir,"gdcm.i"))
 #             contained in subdir gdcmJpeg8SrcDir. But within this subdir
 #             some of the C files should not be compiled (refer to
 #             gdcmJpeg8SrcDir/Makefile.am) !
+
 Jpeg8Sources = glob.glob(os.path.join(gdcmJpeg8SrcDir,"j*.c"))
 Jpeg8SourcesToRemove = ['jmemansi.c', 'jmemname.c', 'jmemdos.c', 'jmemmac.c']
 for Remove in Jpeg8SourcesToRemove:
@@ -58,6 +60,17 @@ for Remove in Jpeg8SourcesToRemove:
       continue
 Sources.extend(Jpeg8Sources)
 
+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.
+   try:
+      Jpeg12Sources.remove(os.path.join(gdcmJpeg12SrcDir, Remove))
+   except ValueError:
+      continue
+Sources.extend(Jpeg12Sources)
+
 # 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")
@@ -66,6 +79,7 @@ vtkSources = []
 vtkSources.extend(glob.glob(os.path.join(gdcmvtkSrcDir,"vtk*.cxx")))
 vtkSources.extend(glob.glob(os.path.join(gdcmSrcDir,"*.cxx")))
 vtkSources.extend(Jpeg8Sources)
+vtkSources.extend(Jpeg12Sources)
 vtkLibraries=["vtkCommon","vtkCommonPython",
               "vtkIO","vtkIOPython",
               "vtkFiltering","vtkFilteringPython"]
@@ -83,7 +97,8 @@ setup(name=ThisModule,
       cmdclass={'build_ext':build_extWrap}, # redirects default build_ext
       ext_modules=[SwigExtension(name='_gdcm',
                                  sources=Sources,
-                                 include_dirs=[gdcmSrcDir,gdcmJpeg8SrcDir],
+                                 include_dirs=[gdcmSrcDir,gdcmJpeg8SrcDir,
+                                               gdcmSrcDir,gdcmJpeg12SrcDir],
                                  libraries=libraries,
                                  define_macros=macros,
                                  swig_cpp=1,