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

标签 python distutils python-3.3 setup.py

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"])]

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

最佳答案

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

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

关于python - 将库路径作为命令行参数传递给 setup.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16984753/

相关文章:

python - 将 f2py 与 distutils 混合

python-3.3 - 我的列表索引有什么问题?指出索引错误

python - Python Descriptors的具体实现

python - 需要 Django 表单帮助

python - 如何获取 Distutils compile() 函数使用的实际命令?

python - 将 python 包安装到相对于站点包的目录中

python - 在生成器中与产量一起返回

python - 如何在 Python 中添加原始输入值?

python - django - 聚合 json 字段特定键并按聚合排序

python - 如何在 matplotlib 中绘制曲线图