setup.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. if sys.platform == "win32":
  9. package = '\\"grasslibs\\"'
  10. else:
  11. package = '"grasslibs"'
  12. macros = [('PACKAGE', package)]
  13. inc_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'include'),
  14. os.path.join(os.path.normpath(os.getenv('GISBASE')), 'include')]
  15. lib_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'lib'),
  16. os.path.join(os.path.normpath(os.getenv('GISBASE')), 'lib')]
  17. gversion = os.getenv('GRASS_VERSION_NUMBER')
  18. libs = ['grass_%s.%s' % (name, gversion)
  19. for name in ['dbmibase',
  20. 'dbmiclient',
  21. 'vector',
  22. 'gis',
  23. 'vedit']]
  24. extras = []
  25. for flag in ['CXXFLAGS',
  26. 'GDALCFLAGS',
  27. 'GDALLIBS',
  28. 'GEOSCFLAGS',
  29. 'WXWIDGETSLIB',
  30. 'WXWIDGETSCXXFLAGS']:
  31. update_opts(os.getenv(flag), macros, inc_dirs, lib_dirs, libs, extras)
  32. setup(
  33. ext_modules= [
  34. Extension(
  35. name = '_grass7_wxvdigit',
  36. sources = ["cats.cpp",
  37. "driver.cpp",
  38. "driver_draw.cpp",
  39. "driver_select.cpp",
  40. "line.cpp",
  41. "message.cpp",
  42. "select.cpp",
  43. "undo.cpp",
  44. "vertex.cpp",
  45. "pseudodc.cpp",
  46. "digit.cpp",
  47. "grass7_wxvdigit.i"],
  48. swig_opts = ['-c++',
  49. '-shadow'],
  50. define_macros = macros,
  51. include_dirs = inc_dirs,
  52. library_dirs = lib_dirs,
  53. libraries = libs,
  54. extra_link_args = extras,
  55. )
  56. ]
  57. )