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_dbmibase',
  14. 'grass_dbmiclient',
  15. 'grass_vector',
  16. 'grass_gis',
  17. 'grass_vedit']
  18. extras = []
  19. for flag in ['GDALCFLAGS',
  20. 'GDALLIBS',
  21. 'GEOSCFLAGS',
  22. 'WXWIDGETSCXXFLAGS']:
  23. update_opts(os.getenv(flag), macros, inc_dirs, lib_dirs, libs, extras)
  24. if sys.platform != 'darwin':
  25. update_opts(os.getenv('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. )