4 setup.py for installing the gdcm-Python bindings using distutils.
6 Created by Mathieu Malaterre, May 2004.
7 Heavily based on setup.py.in from VTK, Prabhu Ramachandran, June 2002.
12 from types import StringType
13 from distutils.core import setup
14 from distutils.util import change_root, convert_path
15 from distutils.command.install_data import install_data
16 from distutils.sysconfig import get_config_var
18 version = "${GDCM_VERSION}",
20 build_lib_dir = "${LIBRARY_OUTPUT_PATH}"
22 build_bin_dir = "${EXECUTABLE_OUTPUT_PATH}"
24 gdcmDictsDir = "${GDCM_SOURCE_DIR}"
25 gdcmDictsDir = os.path.join( gdcmDictsDir, "Dicts" )
27 # You can change this to suit your needs. However you must make sure
28 # that under *nix the libvtk*Python*.so in the specified directory.
29 #install_lib_dir = "${CMAKE_INSTALL_PREFIX}/lib/vtk"
32 """Returns a list of libraries to be installed. """
34 if os.name == 'posix':
35 libs = glob.glob(os.path.abspath(os.path.join(
36 build_lib_dir, '_gdcm' + get_config_var('SO'))))
37 libs = libs + glob.glob(os.path.abspath(os.path.join(
38 build_lib_dir, 'libvtkgdcmPython' + get_config_var('SO'))))
40 d = os.path.normpath(build_lib_dir)
41 if not os.path.isfile(os.path.join(d, 'libvtkgdcmPython.dll')):
42 d = os.path.normpath(os.path.join(build_lib_dir, 'release'))
44 libs = glob.glob(os.path.join(d, 'vtk*Python.dll'))
49 """Returns the appropriate gdcm.py python script
50 that is to be installed."""
52 if os.name == 'posix':
53 f = os.path.join(build_bin_dir, "gdcm.py")
57 win32_bin_dir = build_bin_dir
58 for subdir in ('Debug', 'Release', 'MinSizeRel',
60 win32_bin_dir = os.path.join(build_bin_dir, subdir)
61 if os.path.exists(win32_bin_dir):
63 for i in ('vtkpython.exe', 'pvtkpython.exe'):
64 f = os.path.join(os.path.normpath(win32_bin_dir), i)
75 setup(name="Distutils",
77 description="Python Distribution Utilities",
79 author_email="gward@python.net",
80 url="http://www.python.org/sigs/distutils-sig/",
81 packages=['distutils', 'distutils.command'],
85 setup(name = "gdcmPython",
86 version = "${GDCM_VERSION}",
87 description = "GNU DiCoM",
89 author_email = "frog@creatis.insa-lyon.fr",
90 maintainer = "GDCM Developers",
91 maintainer_email = "dcmlib@creatis.insa-lyon.fr",
93 long_description = "Library dedicated to reading/parsing and writing Dicom files",
94 url = "http://www.creatis.insa-lyon.fr/Public/Gdcm/",
96 packages = ['gdcmPython'],
97 #scripts = get_scripts(),
98 #package_dir = {'gdcmPython': '.'},
99 #data_files = [ ('gdcmPython', 'gdcm.pth') ],
102 #data_files = [('gdcmPython', get_libs()), ('gdcmPython', ['gdcm.pth'])]
103 #data_files = [('Dicts', glob.glob(os.path.join(gdcmDictsDir,"Dicts/*"))) ]