|
| 1 | +diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake |
| 2 | +index 31c2c1e..c890917 100644 |
| 3 | +--- a/cmake/OpenCVDetectPython.cmake |
| 4 | ++++ b/cmake/OpenCVDetectPython.cmake |
| 5 | +@@ -36,7 +36,7 @@ if(PYTHON_EXECUTABLE) |
| 6 | + unset(PYTHON_VERSION_FULL) |
| 7 | + endif() |
| 8 | + |
| 9 | +- if(NOT ANDROID AND NOT IOS) |
| 10 | ++ if(P4A OR NOT ANDROID AND NOT IOS) |
| 11 | + ocv_check_environment_variables(PYTHON_LIBRARY PYTHON_INCLUDE_DIR) |
| 12 | + if(CMAKE_CROSSCOMPILING) |
| 13 | + find_host_package(PythonLibs ${PYTHON_VERSION_MAJOR_MINOR}) |
| 14 | +@@ -51,7 +51,7 @@ if(PYTHON_EXECUTABLE) |
| 15 | + endif() |
| 16 | + endif() |
| 17 | + |
| 18 | +- if(NOT ANDROID AND NOT IOS) |
| 19 | ++ if(P4A OR NOT ANDROID AND NOT IOS) |
| 20 | + if(CMAKE_HOST_UNIX) |
| 21 | + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print get_python_lib()" |
| 22 | + RESULT_VARIABLE PYTHON_CVPY_PROCESS |
| 23 | +@@ -117,7 +117,7 @@ if(PYTHON_EXECUTABLE) |
| 24 | + OUTPUT_STRIP_TRAILING_WHITESPACE) |
| 25 | + endif() |
| 26 | + endif() |
| 27 | +- endif(NOT ANDROID AND NOT IOS) |
| 28 | ++ endif(P4A OR NOT ANDROID AND NOT IOS) |
| 29 | + |
| 30 | + if(BUILD_DOCS) |
| 31 | + find_host_program(SPHINX_BUILD sphinx-build) |
| 32 | +diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt |
| 33 | +index 3c0f2fd..7ba234a 100644 |
| 34 | +--- a/modules/python/CMakeLists.txt |
| 35 | ++++ b/modules/python/CMakeLists.txt |
| 36 | +@@ -5,7 +5,7 @@ |
| 37 | + if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug") |
| 38 | + ocv_module_disable(python) |
| 39 | + endif() |
| 40 | +-if(ANDROID OR IOS OR NOT PYTHONLIBS_FOUND OR NOT PYTHON_USE_NUMPY) |
| 41 | ++if(ANDROID AND NOT P4A OR IOS OR NOT PYTHONLIBS_FOUND OR NOT PYTHON_USE_NUMPY) |
| 42 | + ocv_module_disable(python) |
| 43 | + endif() |
| 44 | + |
| 45 | +diff --git a/modules/androidcamera/src/camera_activity.cpp b/modules/androidcamera/src/camera_activity.cpp |
| 46 | +index 84db3e1..4222526 100644 |
| 47 | +--- a/modules/androidcamera/src/camera_activity.cpp |
| 48 | ++++ b/modules/androidcamera/src/camera_activity.cpp |
| 49 | +@@ -7,6 +7,7 @@ |
| 50 | + #include <string> |
| 51 | + #include <vector> |
| 52 | + #include <algorithm> |
| 53 | ++#include <stdlib.h> |
| 54 | + #include <opencv2/core/version.hpp> |
| 55 | + #include "camera_activity.hpp" |
| 56 | + #include "camera_wrapper.h" |
| 57 | +@@ -342,6 +343,8 @@ std::string CameraWrapperConnector::getPathLibFolder() |
| 58 | + |
| 59 | + char* pathEnd = strrchr(pathBegin, '/'); |
| 60 | + pathEnd[1] = 0; |
| 61 | ++ pathBegin = realpath((std::string(pathBegin)+"../../../../lib").c_str(), lineBuf); |
| 62 | ++ pathBegin = strcat(pathBegin, "/"); |
| 63 | + |
| 64 | + LOGD("Libraries folder found: %s", pathBegin); |
| 65 | + |
0 commit comments