Skip to content

Cleanups for python3 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion python-bindings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ INCLUDE_DIR=..
CXX=g++

PY_INCLUDE_DIR=$(shell python-config --includes)
PYTHON_BIN=$(shell \
if command -v python >/dev/null 2>&1; then echo python; \
elif command -v python3 >/dev/null 2>&1; then echo python3; \
else echo "ERROR: Python not found" >&2; exit 1; \
fi)

# CPPFLAGS is used by the default rules. Using "override" and "+="
# allows the user to prepend things to CPPFLAGS on the command line.
Expand Down Expand Up @@ -30,7 +35,7 @@ py-kdtree_test: py-kdtree.hpp py-kdtree_test.cpp
$(CXX) $(CPPFLAGS) $(LDLIBS) py-kdtree_test.o -o py-kdtree_test

py-kdtree.i: py-kdtree.i.tmpl py-kdtree.hpp.tmpl gen-swig-hpp.py
python gen-swig-hpp.py
$(PYTHON_BIN) gen-swig-hpp.py

py-kdtree_wrap.cxx: py-kdtree.i py-kdtree.hpp py-kdtree.i.tmpl py-kdtree.hpp.tmpl
swig -python -modern -c++ py-kdtree.i
Expand Down
Loading