OSDN Git Service

add pmd_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                  'blender24/vmd_import.py',
43                  'blender24/pmd_export.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                 ])
56             ]
57
58 # スタティックruntime(/MT)とリンクするのでマニフェストが不要だが
59 # mt.exeの呼び出しを止めることができないので
60 for i in range(len(ext_modules)+1):
61     try:
62         setup(name="meshio",
63                 version='0.5',
64                 description='polygon mesh io utilities',
65                 author='ousttrue',
66                 author_email='ousttrue@gmail.com',
67                 url='http://sourceforge.jp/projects/meshio/',
68                 packages=['meshio'],
69                 package_dir={'meshio': '.'},
70                 ext_package='meshio',
71                 ext_modules=ext_modules,
72                 data_files=data_files
73                 )
74         break
75     except:
76         continue
77