【发布时间】:2011-01-02 11:26:11
【问题描述】:
大家好,
我已经花了 3 天时间试图让 OpenCV Python 绑定发生,我有(完整的史诗般的斗争是 documented here)但是尽管在通过 macports 安装 swig 后在 CMake 中打开了 SWIG 标志,我'我没有得到任何 SWIG 操作:(
我的 cmake 命令看起来像:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_SWIG_PYTHON_SUPPORT=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON -D PYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Headers -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_SWIG_PYTHON_SUPPORT=ON -D CMAKE_CXX_COMPILER=/usr/bin/g++-4.2 -D CMAKE_C_COMPILER=/usr/bin/gcc-4.2 ..
导致此错误:
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
所以我猜它找不到我在的那个:
/opt/local/include/libavformat/avformat.h
我该怎么说呢?像
-D CMAKE_CXX_FLAGS="-I/opt/local/include" -D CMAKE_SHARED_LINKER_FLAGS="-L/opt/local/lib"
???
我正在通过 Macports 使用 OSX 10.5.8、Python 2.6 并编译最新的 OpenCV-trunk。
【问题讨论】:
标签: python opencv cmake swig macports