-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve native libraries from AAR file (Maven)
- Loading branch information
1 parent
2f005b0
commit 733f443
Showing
362 changed files
with
19 additions
and
186,358 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,27 @@ | ||
|
||
# | ||
# Copyright (C) The Android Open Source Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.4.1) | ||
|
||
project(FeatureMatchingNative) | ||
# register the project for the C++ language | ||
project(app CXX) | ||
|
||
# create a variable for accessing the opencv library dir | ||
set( | ||
lib_src_dir | ||
${CMAKE_SOURCE_DIR}/../opencv/native | ||
) | ||
# find the opencv native sdk inside the AAR file / maven dependency (prerequisite: prefab = true) | ||
find_package(OpenCV REQUIRED CONFIG) | ||
|
||
# register the opencv header files... | ||
include_directories(${lib_src_dir}/jni/include) | ||
|
||
# register a new library to import... | ||
# register the custom c++ code of the app | ||
add_library( | ||
lib_opencv | ||
app | ||
SHARED | ||
IMPORTED | ||
src/main/cpp/native_opencv.cpp | ||
) | ||
# ...and assign the corresponding location of the precompiled opencv library | ||
# compile with c++20 | ||
set_target_properties( | ||
lib_opencv | ||
PROPERTIES IMPORTED_LOCATION | ||
${lib_src_dir}/libs/${ANDROID_ABI}/libopencv_java4.so | ||
) | ||
|
||
# register the custom c++ code of the app as library | ||
add_library( | ||
native_opencv | ||
SHARED | ||
src/main/cpp/native_opencv.cpp | ||
app | ||
PROPERTIES | ||
CXX_STANDARD 20 | ||
) | ||
|
||
# link the required libs together | ||
target_link_libraries( | ||
native_opencv # includes the custom c++ code of the app | ||
lib_opencv # includes the precompiled opencv lib | ||
android # include android sdk | ||
app # includes the custom c++ code of the app | ||
OpenCV::opencv_java4 # includes the opencv lib from the maven dependency | ||
log # include android logging sdk | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.