setup.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.environ['ARCH_DISTDIR']), 'include'),
  10. os.path.join(os.path.normpath(os.environ['GISBASE']), 'include')]
  11. lib_dirs = [os.path.join(os.path.normpath(os.environ['ARCH_DISTDIR']), 'lib'),
  12. os.path.join(os.path.normpath(os.environ['GISBASE']), 'lib')]
  13. libs = ['grass_dbmibase',
  14. 'grass_dbmiclient',
  15. 'grass_vect',
  16. 'grass_gis',
  17. 'grass_vedit']
  18. extras = []
  19. for flag in ('GDALCFLAGS',
  20. 'GDALLIBS',
  21. 'GEOSCFLAGS',
  22. 'WXWIDGETSCXXFLAGS'):
  23. update_opts(flag, macros, inc_dirs, lib_dirs, libs, extras)
  24. if sys.platform != 'darwin':
  25. update_opts('WXWIDGETSLIB', macros, inc_dirs, lib_dirs, libs, extras)
  26. setup(
  27. ext_modules= [
  28. Extension(
  29. name = '_grass7_wxvdigit',
  30. sources = ["cats.cpp",
  31. "driver.cpp",
  32. "driver_draw.cpp",
  33. "driver_select.cpp",
  34. "line.cpp",
  35. "message.cpp",
  36. "select.cpp",
  37. "undo.cpp",
  38. "vertex.cpp",
  39. "pseudodc.cpp",
  40. "digit.cpp",
  41. "grass7_wxvdigit.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. )