将库路径作为命令行参数传递给setup.py [英] Passing the library path as a command line argument to setup.py

查看:98
本文介绍了将库路径作为命令行参数传递给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之类的选项,以便用户可以设置路径?

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?

推荐答案

您可以在setup.cfg文件中指定它

You can specify it in the setup.cfg file

[build_ext]
include-dir="path/to/your/dir/"

这篇关于将库路径作为命令行参数传递给setup.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆