Last active
August 3, 2019 21:00
-
-
Save vvzen/4e9b36e6361484ce09279b3cc05b4959 to your computer and use it in GitHub Desktop.
Build OpenCV4 on macOS mojave using conda python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Replace all python3.5 with your version | |
export CONDA_ENV_DIR=~/miniconda3/envs/cv | |
export CPLUS_INCLUDE_PATH=$CONDA_ENV_DIR/lib/python3.5 | |
export OPENCV_CONTRIB_DIR=~/Documents/code/learning/python/opencv/opencv_contrib | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D OPENCV_EXTRA_MODULES_PATH=$OPENCV_CONTRIB_DIR/modules \ | |
-D PYTHON3_LIBRARY=$CONDA_ENV_DIR/lib/python3.5m.dylib \ | |
-D PYTHON3_INCLUDE_DIR=$CONDA_ENV_DIR/include/python3.5m \ | |
-D PYTHON3_EXECUTABLE=$CONDA_ENV_DIR/bin/python \ | |
-D PYTHON3_PACKAGES_PATH=$CONDA_ENV_DIR/lib/python3.5/site-packages \ | |
-D BUILD_opencv_python2=OFF \ | |
-D BUILD_opencv_python3=ON \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D INSTALL_C_EXAMPLES=OFF \ | |
-D OPENCV_ENABLE_NONFREE=ON \ | |
-DWITH_IPP=ON \ | |
-D BUILD_EXAMPLES=ON .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment