OSDN Git Service

4304e92ae4f10ea07a2b1c4aaed48ef02218187f
[meshio/meshio.git] / swig / setup.py
1 # coding: utf-8
2
3 from distutils.core import setup, Extension
4 import os
5 import sys
6
7 option={
8         'swig_opts': ['-c++'],
9         'include_dirs': [
10             '../include'
11             ],
12         'libraries': [
13             'meshio',
14             ],
15         'library_dirs': [
16             '../release',
17             ],
18         }
19
20 if os.name=='nt':
21     # vc option
22     option['extra_compile_args']=[
23             '/EHsc', '/MT',
24             ]
25
26 # swig c extensions    
27 ext_modules=[
28         Extension("_mqo", ["mqo.i"], **option),
29         Extension("_pmd", ["pmd.i"], **option),
30         Extension("_vmd", ["vmd.i"], **option),
31         ]
32
33 # blender importers
34 if sys.version_info[0]<3:
35     # blender 2.4
36      data_files=[
37              ('blender24', [
38                  'blender24/README',
39                  'blender/bl24.py',
40                  'blender/mqo_import.py', 
41                  'blender/mqo_export.py',
42                  'blender/pmd_import.py', 
43                  'blender/pmd_export.py', 
44                  ]),
45              ]
46
47 else:
48     # blender2.5
49     data_files=[
50             ('blender25', [
51                 'blender25/README',
52                 ]),
53             ('blender25/io', [
54                 'blender/io/bl25.py',
55                 'blender/io/import_scene_mqo.py',
56                 'blender/io/export_scene_mqo.py',
57                 'blender/io/import_scene_pmd.py',
58                 'blender/io/export_scene_pmd.py',
59                 ]),
60             ]
61
62 # スタティックruntime(/MT)とリンクするのでマニフェストが不要だが
63 # mt.exeの呼び出しを止めることができないので
64 for i in range(len(ext_modules)+1):
65     try:
66         setup(name="meshio",
67                 version='1.00',
68                 description='polygon mesh io utilities',
69                 author='ousttrue',
70                 author_email='ousttrue@gmail.com',
71                 url='http://sourceforge.jp/projects/meshio/',
72                 packages=['meshio'],
73                 package_dir={'meshio': '.'},
74                 ext_package='meshio',
75                 ext_modules=ext_modules,
76                 data_files=data_files
77                 )
78         break
79     except:
80         continue
81