setup.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/env python
  2. # Setup script for wxGUI vdigit extension.
  3. import os
  4. import sys
  5. sys.path.append('..')
  6. from build_ext import update_opts
  7. from distutils.core import setup, Extension
  8. macros = [('PACKAGE', '"grasslibs"')]
  9. inc_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'include'),
  10. os.path.join(os.path.normpath(os.getenv('GISBASE')), 'include')]
  11. lib_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'lib'),
  12. os.path.join(os.path.normpath(os.getenv('GISBASE')), 'lib')]
  13. libs = ['grass_gis',
  14. 'grass_nviz',
  15. 'grass_ogsf',
  16. 'grass_g3d']
  17. extras = []
  18. for flag in ['GDALCFLAGS',
  19. 'GDALLIBS',
  20. 'WXWIDGETSCXXFLAGS',
  21. 'OPENGLINC',
  22. 'OPENGLLIB',
  23. 'OPENGLULIB']:
  24. update_opts(os.getenv(flag), macros, inc_dirs, lib_dirs, libs, extras)
  25. if sys.platform != 'darwin':
  26. update_opts(os.getenv('WXWIDGETSLIB'), macros, inc_dirs, lib_dirs, libs, extras)
  27. if os.getenv('OPENGL_X11') == '1':
  28. update_opts(os.getenv('XCFLAGS'), macros, inc_dirs, lib_dirs, libs, extras)
  29. setup(
  30. ext_modules= [
  31. Extension(
  32. name = '_grass7_wxnviz',
  33. sources=["change_view.cpp",
  34. "draw.cpp",
  35. "init.cpp",
  36. "lights.cpp",
  37. "load.cpp",
  38. "surface.cpp",
  39. "vector.cpp",
  40. "volume.cpp",
  41. "grass7_wxnviz.i"],
  42. swig_opts = ['-c++',
  43. '-shadow'],
  44. define_macros = macros,
  45. include_dirs = inc_dirs,
  46. library_dirs = lib_dirs,
  47. libraries = libs,
  48. extra_link_args = extras,
  49. )
  50. ]
  51. )