Skip to content

Instantly share code, notes, and snippets.

@gjpicker
Last active February 15, 2019 06:25
Show Gist options
  • Save gjpicker/5930f785f7ab2670844c83ed6fb80981 to your computer and use it in GitHub Desktop.
Save gjpicker/5930f785f7ab2670844c83ed6fb80981 to your computer and use it in GitHub Desktop.
cmake opencv_4.0.1
cmake -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.0.1/modules \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D PYTHON_EXECUTABLE=$(which python2) \
-D PYTHON3_EXECUTABLE=$(which python3) \
-D PYTHON3_LIBRARY=`python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))'` \
-D PYTHON3_INCLUDE_DIR=`python -c 'import distutils.sysconfig as s; print(s.get_python_inc())'` \
-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 \
-D BUILD_EXAMPLES=ON \
..
@gjpicker
Copy link
Author

this was inspired by this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment