I need to build OpenCV from source and I have limited space, so, I have to build OpenCV on a module basis (https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html - Build limited set of modules). OK, cmake and make work fine.
Would be easier to use these OpenCV modules from python so I add cmake -D BUILD_opencv_python3=ON but make install does not create the prefix/lib/pythonX.Y/site-packages directory I expected. There is no python related option but only a CMake option as far as I understand the doc.
How to get python(3) binding for OpenCV when building it on a module basis ?
Once installed, how to set up environnement to get python -c "import cv2" to work with my custom-built OpenCV ?
UPDATE
Running ubuntu L4T on jetson. CMake outputs :
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.6.9)
-- Libraries: NO
-- numpy: /home/me/.local/lib/python3.6/site-packages/numpy/core/include (ver 1.19.5)
-- install path: -
So I guess empty install path hides a problem behind... But grep -ni OPENCV_PYTHON3_INSTALL_PATH CMakeCache.txt returns nothing.
At this point, I tried to add cmake -DOPENCV_PYTHON3_INSTALL_PATH=~/Programs/opencv/local/lib/python3.6/site-packages/, still nothing in cmake output (blank install path) but
grep -ni OPENCV_PYTHON3_INSTALL_PATH CMakeCache.txt
1076:OPENCV_PYTHON3_INSTALL_PATH:UNINITIALIZED=~/Programs/opencv/local/lib/python3.6/site-packages/
And after make install (without sudo - I don't have root privilege and need local install), I have no python binding in the local install.
... Any clue would be appreciated !
Note: compiling opencv-4.5.4 on L4T ubuntu