OSDN Git Service

fix blender2.5 export.
[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                  'mqo_import.py', 
40                  'mqo_export.py',
41                  'pmd_import.py', 
42                  'pmd_export.py', 
43                  'blender24/vmd_import.py',
44                  ])
45              ]
46
47 else:
48     # blender2.5
49     data_files=[
50             ('blender25', [
51                 'blender25/README',
52                 'import_scene_mqo.py',
53                 'export_scene_mqo.py',
54                 'import_scene_pmd.py',
55                 'export_scene_pmd.py',
56                 ])
57             ]
58
59 # スタティックruntime(/MT)とリンクするのでマニフェストが不要だが
60 # mt.exeの呼び出しを止めることができないので
61 for i in range(len(ext_modules)+1):
62     try:
63         setup(name="meshio",
64                 version='0.6',
65                 description='polygon mesh io utilities',
66                 author='ousttrue',
67                 author_email='ousttrue@gmail.com',
68                 url='http://sourceforge.jp/projects/meshio/',
69                 packages=['meshio'],
70                 package_dir={'meshio': '.'},
71                 ext_package='meshio',
72                 ext_modules=ext_modules,
73                 data_files=data_files
74                 )
75         break
76     except:
77         continue
78