build opencv with python support

cmake -DPYTHON_LIBRARY=/opt/anaconda/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR=/opt/anaconda/include/python2.7 -DCMAKE_BUILD_TYPE=RELEASE -DWITH_CUDA=OFF -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF -DBUILD_WITH_DEBUG_INFO=OFF -DBUILD_opencv_apps=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_python=ON ..

You have to define PYTHON_LIBRARY and PYTHON_INCLUDE_DIR variables explicitly, or OpenCV may not find PythonLibs.

posted @ 2015-03-29 01:27  n0p  阅读(457)  评论(0编辑  收藏  举报