Skip to content

Commit

Permalink
Allow to update native opencv via github action
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltroger committed Feb 27, 2024
1 parent 2e78f19 commit 463164f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/update_opencv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update Native OpenCV

on:
workflow_dispatch:
inputs:
version:
description: 'Version (e.g. 4.9.0)'
required: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: download sdk
run: wget https://github.com/opencv/opencv/releases/download/${{ github.event.inputs.version }}/opencv-${{ github.event.inputs.version }}-android-sdk.zip

- name: Unzip
run: unzip opencv-${{ github.event.inputs.version }}-android-sdk.zip

- name: copy new files
run: |
rm -rd opencv/native
mkdir opencv/native
mkdir opencv/native/jni
mkdir opencv/native/libs
cp -r OpenCV-android-sdk/sdk/native/jni/include opencv/native/jni/
cp -r OpenCV-android-sdk/sdk/native/libs opencv/native/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: feature/update_opencv_native
title: Update of OpenCV Native
commit-message: Update of OpenCV Native
body: Don't forget to also update the Java dependency (coming through Maven)
add-paths: |
opencv/native/*
6 changes: 3 additions & 3 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ project(FeatureMatchingNative)
# create a variable for accessing the opencv library dir
set(
lib_src_dir
${CMAKE_SOURCE_DIR}/../opencv
${CMAKE_SOURCE_DIR}/../opencv/native
)

# register the opencv header files...
include_directories(${lib_src_dir}/native/jni/include)
include_directories(${lib_src_dir}/jni/include)

# register a new library to import...
add_library(
Expand All @@ -38,7 +38,7 @@ add_library(
set_target_properties(
lib_opencv
PROPERTIES IMPORTED_LOCATION
${lib_src_dir}/native/jni/${ANDROID_ABI}/libopencv_java4.so
${lib_src_dir}/libs/${ANDROID_ABI}/libopencv_java4.so
)

# register the custom c++ code of the app as library
Expand Down

0 comments on commit 463164f

Please sign in to comment.