-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
82 lines (65 loc) · 1.93 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
cmake_minimum_required(VERSION 3.8)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/KotlinCMakeModule)
project(OpenCV-KotlinNative Kotlin)
# OpenCV2
set(OCV2_LIBRARY "-lopencv_core -lopencv_highgui -lopencv_imgproc")
if (APPLE)
set(OPENCV2_INCLUDE_DIR /usr/local/opt/opencv@2/include)
elseif (UNIX)
set(OPENCV2_INCLUDE_DIR /usr/local/include)
endif ()
message("${OPENCV2_INCLUDE_DIR}")
##### opencv2
cinterop(
NAME libopencv2_core
DEF_FILE src/c_interop/libopencv2_core.def
COMPILER_OPTS "-I ${OPENCV2_INCLUDE_DIR}"
)
cinterop(
NAME libopencv2_highgui
DEF_FILE src/c_interop/libopencv2_highgui.def
COMPILER_OPTS "-I ${OPENCV2_INCLUDE_DIR}"
)
cinterop(
NAME libopencv2_imgproc
DEF_FILE src/c_interop/libopencv2_imgproc.def
COMPILER_OPTS "-I ${OPENCV2_INCLUDE_DIR}"
)
##### execs
konanc_executable(
NAME OpenCV_Hello_Lena_K
SOURCES samples/hello_lena/personal_version src/kotlin/
LIBRARIES libopencv2_highgui
LINKER_OPTS "${OCV2_LIBRARY}"
)
konanc_executable(
NAME OpenCV_Hello_Lena_C
SOURCES samples/hello_lena/c_interop_version
LIBRARIES libopencv2_highgui
LINKER_OPTS "${OCV2_LIBRARY}"
)
konanc_executable(
NAME OpenCV_Image_Scale
SOURCES samples/image_scale/c_interop_version src/kotlin/
LIBRARIES libopencv2_highgui
LINKER_OPTS "${OCV2_LIBRARY}"
)
#####
konanc_executable(
NAME OpenCV2_Simple_Run
SOURCES samples/cv2_simple_run/
LIBRARIES libopencv2_core
LINKER_OPTS "${OCV2_LIBRARY}"
)
konanc_executable(
NAME OpenCV_Simple_Highgui
SOURCES samples/cv2_simple_highgui/
LIBRARIES libopencv2_highgui
LINKER_OPTS "${OCV2_LIBRARY}"
)
konanc_executable(
NAME OpenCV_Simple_Output
SOURCES samples/SaveImage/
LIBRARIES libopencv2_highgui libopencv2_imgproc
LINKER_OPTS "${OCV2_LIBRARY}"
)