将库路径作为命令行参数传递给setup.py

Ale*_*xey 10 python distutils setup.py python-3.3

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"])]
Run Code Online (Sandbox Code Playgroud)

这是我的setup.py脚本的一部分.如何通过命令行参数传递include_dirs或library_dirs等选项,以便用户可以设置路径?

Tom*_*ton 3

认为这可能是您正在寻找的:

http://docs.python.org/2/distutils/configfile.html