From 4268afb80798e764bc11da433aecdc98574e38c1 Mon Sep 17 00:00:00 2001 From: Vincent Mora Date: Thu, 1 Mar 2018 13:07:06 +0100 Subject: [PATCH] fixup build for osgeo4w --- setup.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 1934ea0..646e54c 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ from distutils.core import setup, Extension import sys +import os # to avoid compilation warning import distutils.sysconfig @@ -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'])