-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
96 lines (78 loc) · 3.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
cmake_minimum_required(VERSION 3.10)
project(MPP_cmake)
set(CMAKE_CXX_STANDARD 14)
option(BUILD_DEMO "IF BUILD LIB WITH DEMO" ON)
if (BUILD_DEMO)
message(STATUS "BUILD_DEMO is ON")
else ()
message(STATUS "BUILD_DEMO is OFF")
endif ()
# set OpenCV_lite build DIR
# TODO change the opencv_lite name from OpenCV to OpenCVLite.
# The opencv_lite version can be found at https://github.com/zihaomu/opencv_lite.
# Please make sure you have compiled opencv_lite with MNN dnn backend.
set(OpenCV_DIR "/Users/moo/work/my_project/opencv_lite/build") # for android platform, please check the following tutorial.
# for android platform, we need assign the platform based lib, at leaset the "arm64-v8a" and "armeabi-v7a"
# Please orgnize the folder like the following:
# lib:
# - arm64-v8a, it should contains: libMNN.so libopencv_core.so libopencv_dnn.so libopencv_imgproc.so
# - armeabi-v7a, it should contains: libMNN.so libopencv_core.so libopencv_dnn.so libopencv_imgproc.so
# - include/opencv2
if (ANDROID)
set(OpenCV_DIR "/Users/mzh/work/my_project/opencv_lite_release/android_26")
include_directories("${OpenCV_DIR}/include")
set(OpenCV_DIR_Android "")
if (ANDROID_ABI STREQUAL "arm64-v8a")
set(OpenCV_DIR_Android "${OpenCV_DIR}/arm64-v8a")
elseif (ANDROID_ABI STREQUAL "armeabi-v7a")
set(OpenCV_DIR_Android "${OpenCV_DIR}/armeabi-v7a")
endif ()
set(OpenCV_LIBS "")
set(LIB_MNN "${OpenCV_DIR_Android}/libMNN.so")
set(LIB_opencv_core "${OpenCV_DIR_Android}/libopencv_core.so")
set(LIB_opencv_dnn "${OpenCV_DIR_Android}/libopencv_dnn.so")
set(LIB_opencv_imgproc "${OpenCV_DIR_Android}/libopencv_imgproc.so")
set(LIB_ANDROID_LOG "")
if(ANDROID)
find_library(log-lib log)
message(STATUS "Found android log lib at ${log-lib}!")
endif()
if (NOT LIB_opencv_core)
message(SEND_ERROR "Cound not found opencv_core from ${OpenCV_DIR_Android}")
endif ()
list(APPEND OpenCV_LIBS ${LIB_MNN})
list(APPEND OpenCV_LIBS ${LIB_opencv_core})
list(APPEND OpenCV_LIBS ${LIB_opencv_dnn})
list(APPEND OpenCV_LIBS ${LIB_opencv_imgproc})
list(APPEND OpenCV_LIBS ${log-lib})
else ()
find_package(OpenCV REQUIRED)
if (OpenCV_FOUND)
message(STATUS "Found OpenCV Lib at ${OpenCV_DIR}!")
include_directories( ${OpenCV_INCLUDE_DIRS})
else ()
message(SEND_ERROR "Cound nont found OpenCV lib at ${OpenCV_DIR}")
endif ()
endif ()
#mpp_vision face detector
include(${CMAKE_SOURCE_DIR}/face_detector/CMakeLists.txt)
#mpp_vision face landmarker
include(${CMAKE_SOURCE_DIR}/face_landmarker/CMakeLists.txt)
#mpp_vision hand detector
include(${CMAKE_SOURCE_DIR}/hand_detector/CMakeLists.txt)
#mpp_vision hand landmark
include(${CMAKE_SOURCE_DIR}/hand_landmarker/CMakeLists.txt)
#mpp_vision pose detector
include(${CMAKE_SOURCE_DIR}/pose_detector/CMakeLists.txt)
#mpp_vision pose landmark
include(${CMAKE_SOURCE_DIR}/pose_landmarker/CMakeLists.txt)
#mpp_vision interactive_segmenter
include(${CMAKE_SOURCE_DIR}/interactive_segmenter/CMakeLists.txt)
#mpp_vision hair_segmenter
include(${CMAKE_SOURCE_DIR}/hair_segmenter/CMakeLists.txt)
#mpp_vision selfie_segmenter
include(${CMAKE_SOURCE_DIR}/selfie_segmenter/CMakeLists.txt)
#mpp_vision iris_tracker
include(${CMAKE_SOURCE_DIR}/iris_tracker/CMakeLists.txt)
#mpp_vision holistic tracker
include(${CMAKE_SOURCE_DIR}/holistic_tracker/CMakeLists.txt)