Skip to content

Commit

Permalink
Search /usr/local/include on BSDs
Browse files Browse the repository at this point in the history
  • Loading branch information
jalan committed Feb 10, 2018
1 parent 37b77e2 commit 9d48fef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
import subprocess
from setuptools import Extension
from setuptools import setup
Expand All @@ -18,6 +19,12 @@ def poppler_cpp_at_least(version):
return True


# On some BSDs, poppler is in /usr/local, which is not searched by default
if platform.system() in ["FreeBSD", "OpenBSD"]:
include_dirs = ["/usr/local/include"]
else:
include_dirs = None

macros = [
("POPPLER_CPP_AT_LEAST_0_30_0", int(poppler_cpp_at_least("0.30.0"))),
]
Expand All @@ -26,6 +33,7 @@ def poppler_cpp_at_least(version):
"pdftotext",
sources=["pdftotext.cpp"],
libraries=["poppler-cpp"],
include_dirs=include_dirs,
define_macros=macros,
extra_compile_args=["-Wall"],
)
Expand Down

0 comments on commit 9d48fef

Please sign in to comment.