Error message:
CMake Error at CMakeLists.txt:11 (message):
FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
第一次没有cd到my_build_dir,报错:不能再 source 里build。
cd后,还是报错。
Google下,需要删除Cache才可以
mkdir my_build_dir
cd my_build_dir
rm ../CMakeCache.txt
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") -D OPENCV_EXTRA_MODULES_PATH=/Users/timpoulsen/repos/opencv/opencv_contrib/modules -D PYTHON3_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -D PYTHON_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -D PYTHON3_EXECUTABLE=$(which python) -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=ON -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D WITH_FFMPEG=ON -D BUILD_EXAMPLES=ON ..