【发布时间】:2013-01-24 21:38:11
【问题描述】:
我正在编写一个 C++ 库,该库可以在 Mac 和 Linux 上的 C++ 和 Python 中使用。所以我决定在我的项目中使用 CMake 和 SWIG。
正如 SWIG 2.0 文档中所述,SWIG 和 CMake 的组合在我的 Mac 上也可以正常工作。 http://www.swig.org/Doc2.0/SWIGDocumentation.html#Introduction_build_system
但我有一个关于make install 的问题。
输入cmake .和make后,成功生成_example.so。但是make install 不起作用,因为自动生成的Makefile 没有install 目标。我想知道如何在 Makefile 中添加 install 目标。我希望将_example.so 安装在每个系统上的site-packages 目录下。
如果有人能告诉我如何修改上面链接中编写的 CMake 示例,我将不胜感激。
【问题讨论】:
标签: c++ python makefile cmake swig