mirror of
https://github.com/opencv/opencv.git
synced 2024-12-16 10:29:11 +08:00
aa6b399b5a
- Use the same tools and plugins for SDK build and AAR build - Added script to test Gradle-based samples against local maven repo - Various local fixes and debug prints
23 lines
709 B
CMake
23 lines
709 B
CMake
cmake_minimum_required(VERSION 3.6)
|
|
|
|
set(target mixed_sample)
|
|
project(${target} CXX)
|
|
|
|
if (OPENCV_FROM_SDK)
|
|
message(STATUS "Using OpenCV from local SDK")
|
|
set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
|
|
else()
|
|
message(STATUS "Using OpenCV from AAR (Maven repo)")
|
|
set(ANDROID_OPENCV_COMPONENTS "OpenCV::opencv_java${OPENCV_VERSION_MAJOR}" CACHE STRING "")
|
|
endif()
|
|
|
|
message(STATUS "ANDROID_ABI=${ANDROID_ABI}")
|
|
find_package(OpenCV REQUIRED COMPONENTS ${ANDROID_OPENCV_COMPONENTS})
|
|
|
|
file(GLOB srcs *.cpp *.c)
|
|
file(GLOB hdrs *.hpp *.h)
|
|
|
|
include_directories("${CMAKE_CURRENT_LIST_DIR}")
|
|
add_library(${target} SHARED ${srcs} ${hdrs})
|
|
target_link_libraries(${target} ${ANDROID_OPENCV_COMPONENTS})
|