2018-11-06 01:39:09 +08:00
|
|
|
cmake_minimum_required(VERSION 3.6)
|
|
|
|
|
2023-11-17 19:17:17 +08:00
|
|
|
set(target JNIpart)
|
2018-11-06 01:39:09 +08:00
|
|
|
project(${target} CXX)
|
|
|
|
|
2023-11-17 19:17:17 +08:00
|
|
|
if (OPENCV_FROM_SDK)
|
|
|
|
set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
|
|
|
|
else()
|
|
|
|
set(ANDROID_OPENCV_COMPONENTS "OpenCV::opencv_java${OPENCV_VERSION_MAJOR}" CACHE STRING "")
|
|
|
|
endif()
|
|
|
|
|
2018-11-06 01:39:09 +08:00
|
|
|
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} -lGLESv2 -lEGL -lOpenCL)
|