Skip to content

Instantly share code, notes, and snippets.

@marschhuynh
Last active December 6, 2017 05:07
Show Gist options
  • Save marschhuynh/033a70110c08cae4a01c5708ccec2cef to your computer and use it in GitHub Desktop.
Save marschhuynh/033a70110c08cae4a01c5708ccec2cef to your computer and use it in GitHub Desktop.
Build open cv for python on Mac
cmake -D BUILD_TIFF=ON \
-D BUILD_opencv_java=OFF \
-D WITH_CUDA=OFF \
-D WITH_OPENGL=ON \
-D WITH_OPENCL=ON \
-D WITH_IPP=OFF \
-D WITH_TBB=ON \
-D WITH_EIGEN=ON \
-D WITH_V4L=ON \
-D WITH_VTK=OFF \
-D WITH_FFMPEG=1 \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D CMAKE_BUILD_TYPE=RELEASE \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D CMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") \
-D PYTHON3_EXECUTABLE=$(which python) \
-D PYTHON_DEFAULT_EXECUTABLE=$(which python3) \
-D PYTHON3_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON3_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment