Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Commit

Permalink
fixup build for osgeo4w
Browse files Browse the repository at this point in the history
  • Loading branch information
vmora committed Mar 1, 2018
1 parent 6880067 commit 4268afb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from distutils.core import setup, Extension
import sys
import os

# to avoid compilation warning
import distutils.sysconfig
Expand All @@ -8,16 +9,23 @@
if type(value) == str:
cfg_vars[key] = value.replace("-Wstrict-prototypes", "").replace("-DNDEBUG", "-DDEBUG")

path_separator = ":" if os.name == "posix" else ";"
cgal = "CGAL" if "CGAL_LIBNAME" not in os.environ else os.environ["CGAL_LIBNAME"]
gmp = "gmp" if "GMP_LIBNAME" not in os.environ else os.environ["GMP_LIBNAME"]
mpfr = "mpfr" if "MPFR_LIBNAME" not in os.environ else os.environ["MPFR_LIBNAME"]
boost_python = 'boost_python-py{}{}'.format(*sys.version_info[:2]) if "BOOSTPYTHON_LIBNAME" not in os.environ else os.environ["BOOSTPYTHON_LIBNAME"]

mymodule = Extension('fourmy._fourmy',
define_macros = [('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')],
include_dirs = ['/usr/local/include'],
libraries = ['CGAL', 'gmp', 'mpfr', 'boost_python-py{}{}'.format(*sys.version_info[:2])],
include_dirs = [] if "INCLUDE_PATH" not in os.environ else os.environ["INCLUDE_PATH"].split(path_separator),
library_dirs = [] if "LIBRARY_PATH" not in os.environ else os.environ["LIBRARY_PATH"].split(path_separator),
libraries = [cgal, gmp, mpfr, boost_python],

sources = ['fourmy/_fourmy.cc'])

setup (name = 'fourmy',
version = '0.1',
version = '0.0.1',
description = 'Some functions from CGAL for GIS, it does not aim to become full CGAL bindings. The interface is modeled after shapely.',
ext_modules = [mymodule],
packages=['fourmy'])

0 comments on commit 4268afb

Please sign in to comment.