@@ -39,6 +39,7 @@ set(BUILD_opencv_python_bindings_generator OFF CACHE BOOL "" FORCE)
3939set (BUILD_opencv_python_tests OFF CACHE BOOL "" FORCE )
4040set (BUILD_opencv_ts OFF CACHE BOOL "" FORCE )
4141set (BUILD_opencv_world OFF CACHE BOOL "" FORCE )
42+ set (OPENCV_PYTHON_SKIP_DETECTION ON CACHE BOOL "" FORCE )
4243
4344# Disable all optional I/O and hardware backends
4445set (WITH_FFMPEG OFF CACHE BOOL "" FORCE )
@@ -75,6 +76,17 @@ set(CV_DISABLE_OPTIMIZATION OFF CACHE BOOL "" FORCE)
7576set (CPU_DISPATCH "" CACHE STRING "" FORCE )
7677set (ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE )
7778
79+ # Disable OpenCV's install rules to prevent polluting our wheel
80+ set (INSTALL_CREATE_DISTRIB OFF CACHE BOOL "" FORCE )
81+ set (OPENCV_BIN_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
82+ set (OPENCV_LIB_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
83+ set (OPENCV_3P_LIB_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
84+ set (OPENCV_INCLUDE_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
85+ set (OPENCV_OTHER_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
86+ set (OPENCV_LICENSES_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
87+ set (OPENCV_SAMPLES_SRC_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
88+ set (OPENCV_CONFIG_INSTALL_PATH "opencv_unused" CACHE STRING "" FORCE )
89+
7890FetchContent_Declare (
7991 opencv
8092 GIT_REPOSITORY https://github.com/opencv/opencv.git
@@ -85,6 +97,9 @@ FetchContent_MakeAvailable(opencv)
8597
8698# --- pybind11 ---
8799if (BUILD_PYTHON_BINDINGS)
100+ # Find Python first so pybind11 uses the correct interpreter
101+ find_package (Python REQUIRED COMPONENTS Interpreter Development.Module NumPy )
102+
88103 FetchContent_Declare (
89104 pybind11
90105 GIT_REPOSITORY https://github.com/pybind/pybind11.git
0 commit comments