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?
Think this may be what you're looking for:
You can specify it in the setup.cfg file
[build_ext]
include-dir="path/to/your/dir/"
来源:https://stackoverflow.com/questions/16984753/passing-the-library-path-as-a-command-line-argument-to-setup-py