OSDN Git Service

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