So I have a Python package – it’s all set up on PyPI, and on GitHub, no problem. This is something I’m relatively familiar with.
What is unknown to me is: the notion of installing a CMake script as part of the python package install process. The python package in question is a development tool – you use it to preprocess some of your C/C++/Obj-C/Obj-C++ source files and generate some predefined macros in a header – and it works well when it’s wrapped in a CMake macro (for example like so) and executed as part of a proper chain of dependencies.
For one, I am not sure how to approach this, as there seem to be significant differences between the setuptools sandbox stance and distutils’ willing systems-level installer integration – and then even if I did know how to go about setting things up correctly in setup.py
, I can’t find a good precedent on where a CMake script pertaining to a Python package might live.
All thoughts and insights on the matter are welcome.
答案 0 :(得分:1)
我花了一段时间才明白你的问题。如果我理解正确,你要做的是在cmake的标准安装位置提供IodSymbolize.cmake,以便依赖你的软件(symbolizer)的其他用户/项目可以在他们的构建过程中使用它。我认为你正朝着一个好的方向思考,试图为你的软件包的最终用户提供服务。好问题!
以下是我对cmake世界中事物如何运作的理解。
假设我是想要使用“symbolizer”可执行文件的最终用户。我要做的是 find_package(符号化)。这将尝试找出可执行文件的位置,并设置可在构建过程中使用的某些变量。
您需要提供Findsymbolizer.cmake文件。
请查看:http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
如果你是Unix / Linux平台,还要查看/ usr / / share / cmake / Modules目录中提供的Find * .cmake文件。
Findsymbolizer.cmake文件正常工作后,将其发送到cmake邮件列表进行审核。一旦被接受,它可以打包在cmake的下一个版本中。然后你的模块可用于cmake。希望我回答你的问题。如果您需要更多信息,请更新。