import os
-import commands
+import shutil
from distutils.core import setup, Extension
def exec_command(cmd):
extra_compile_args=["/EHsc", "/wd4996"]
libraries=[]
include_dirs=['../../src', BOOST_ROOT]
+ if os.path.exists("meshio/mqo.py"):
+ os.remove("meshio/mqo.py")
+ if os.path.exists("meshio/pmd.py"):
+ os.remove("meshio/pmd.py")
exec_command("swig -c++ -python -o mqo_wrap.cpp -D_MSC_VER ../mqo.i")
exec_command("swig -c++ -python -o pmd_wrap.cpp -D_MSC_VER ../pmd.i")
- exec_command("mv mqo.py pmd.py meshio")
+ shutil.move("mqo.py", "meshio")
+ shutil.move("pmd.py", "meshio")
else:
extra_compile_args=['-std=c++0x']
libraries=["iconv"]
include_dirs=['../../src']
+ if os.path.exists("meshio/mqo.py"):
+ os.remove("meshio/mqo.py")
+ if os.path.exists("meshio/pmd.py"):
+ os.remove("meshio/pmd.py")
exec_command("swig -c++ -python -o mqo_wrap.cpp ../mqo.i")
exec_command("swig -c++ -python -o pmd_wrap.cpp ../pmd.i")
- exec_command("mv mqo.py pmd.py meshio")
+ shutil.move("mqo.py", "meshio")
+ shutil.move("pmd.py", "meshio")
setup(
name='meshio',