modules = [Extension("MyLibrary",
src,
language = "c++",
extra_compile_args=["-fopenmp", "-std=c++11", "-DNOLOG4CXX"], # log4cxx is not currently used
extra_link_args=["-fopenmp", "-std=c++11"],
include_dirs=[os.path.join(os.path.expanduser("~"), (os.path.join(gtest, "include"))],
library_dirs=[log4cxx_library, os.path.join(os.path.expanduser("~"), gtest)],
libraries=["log4cxx", "gtest"])]
This is a part of my setup.py script. How do I pass options like include_dirs or library_dirs through command line arguments, so that path could be set up by the user?
If you're using
pip install
you can do this to specifylibrary_dirs
, for example:or just:
--global-option
also appears to work. See https://stackoverflow.com/a/22942120/1843329From the docs for
pip install
:You can specify it in the setup.cfg file
Think this may be what you're looking for:
http://docs.python.org/2/distutils/configfile.html