Skip to content

Commit

Permalink
guard hack to only apply to py-opencv
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Jun 26, 2023
1 parent 1043d03 commit 1a7e2d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions recipe/build-py.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cmake -G "Ninja" ^
-DCMAKE_BUILD_TYPE="Release" ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DMY_SUPER_SECRET_VARIABLE=ON ^
-DOPENCV_INITIAL_PASS=ON ^
-DOPENCV_PYTHON_STANDALONE_INSTALL_PATH=%SP_DIR% ^
-DOPENCV_PYTHON_PIP_METADATA_INSTALL=ON ^
Expand Down
1 change: 1 addition & 0 deletions recipe/build-py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_PREFIX_PATH=${PREFIX} \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DMY_SUPER_SECRET_VARIABLE=ON \
-DOPENCV_INITIAL_PASS=ON \
-DOPENCV_PYTHON_INSTALL_PATH=${SP_DIR} \
-DOPENCV_PYTHON_PIP_METADATA_INSTALL=ON \
Expand Down
14 changes: 8 additions & 6 deletions recipe/patches_opencv/0006-include-OpenCVModule.cmake.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
From 582ae4068d357c3d181b058557130f45baa6557d Mon Sep 17 00:00:00 2001
From 860d6d249fca7b0c9888da90b70b2328fa418f83 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Mon, 26 Jun 2023 20:15:31 +1100
Subject: [PATCH 6/6] include OpenCVModule.cmake

---
modules/python/bindings/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
modules/python/bindings/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)

diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt
index b39c679615..6933a4c031 100644
index b39c679615..6396374d20 100644
--- a/modules/python/bindings/CMakeLists.txt
+++ b/modules/python/bindings/CMakeLists.txt
@@ -1,3 +1,4 @@
+include($ENV{SRC_DIR}/cmake/OpenCVModule.cmake)
@@ -1,3 +1,6 @@
+if(DEFINED MY_SUPER_SECRET_VARIABLE)
+ include($ENV{SRC_DIR}/cmake/OpenCVModule.cmake)
+endif()
set(MODULE_NAME "python_bindings_generator")
set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
ocv_add_module(${MODULE_NAME} INTERNAL)

0 comments on commit 1a7e2d5

Please sign in to comment.