imposm-parser
imposm-parser copied to clipboard
Specifying include_dirs on OSX?
I had to make the following change to setup.py in order to build/install imposm.parser on OSX.
ext_modules=[
Extension("imposm.parser.pbf.OSMPBF",
["imposm/parser/pbf/osm.cc", "imposm/parser/pbf/osm.pb.cc"], libraries=['protobuf'],
include_dirs=['/usr/local/include'] # Add include_dirs
),
],
Is there a way to explicitly tell imposm.parser where to look for the protobuf headers?
I first tried running python setup.py config -I/usr/local/include but that didn't seem to work.
My knowledge of setuptools is minimal, so I'm sorry if this is just a lack of understanding on my part.
I believe setuptools only allows you to pass through the library and include path when you issue the build_ext command. Normally, you would do:
python setup.py build_ext -L<lib path> -I<include path>
python setup.py build
And all would be rosy. Unfortunately, because of the custom build command, I believe the C++ files being written by protoc mean that every time a setup.py build is done, the build_ext command is also run. This is contrary to standard distutils which can avoid the build_ext step in some situations (if it's already run, for example).
I believe to be genuinely customisable with a build path, the build_ext command will need to look at whether the generated files are out of date or not.
HTH
I second in on Windows.