diff --git a/.github/workflows/update_opencv.yml b/.github/workflows/update_opencv.yml new file mode 100644 index 0000000..dd5f9eb --- /dev/null +++ b/.github/workflows/update_opencv.yml @@ -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/* + diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 45906f6..c03b0be 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -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( @@ -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