I am Charmie

メモとログ

enable OpenCV-Python compilation with OpenCV 3.2.0

With default CMakeLists.txt, we cannot compile OpenCV-Python with OpenCV 3.2.0 because 1. add_subdirectory() for python2 do not work appropriately 2. add_subdirectory() for python3 do not work appropriately 3. CMakeLists.txt in the root directory does not add python2/3 include directories.

So the solution is here. Let opencv-3.2.0_ROOT denote the root directory of OpenCV 3.2.0. We need to fix 3 files.

  1. opencv-3.2.0_ROOT/modules/python/python2/CMakeLists.txt

    1 PYTHON2_INCLUDE_PATH -> PYTHON2_INCLUDE_DIR

  2. opencv-3.2.0_ROOT/modules/python/python3/CMakeLists.txt

    1 PYTHON3_INCLUDE_PATH -> PYTHON3_INCLUDE_DIR

  3. opencv-3.2.0_ROOT/CMakeLists.txt add the following lines after #573 if(BUILD_opencv_python2) ocv_include_directories(${PYTHON2_INCLUDE_DIR}) endif() if(BUILD_opencv_python3) ocv_include_directories(${PYTHON3_INCLUDE_DIR}) endif()