Dana
2025-12-01 dd7c75d0d989835c1437e0cfa071408a23d993cd
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
cmake_minimum_required(VERSION 3.4.1)
 
# 创建变量JNI_LIBS_DIR
set(JNI_LIBS_DIR ${CMAKE_SOURCE_DIR}/src/main/jniLibs)
 
set(CMAKE_BUILD_TYPE "Release")
 
add_definitions("-O3")
#set(CMAKE_CXX_FLAGS "-O3")
#set(CMAKE_C_FLAGS "-O3")
 
add_library( # Sets the name of the library.
        usbcamera-lib
 
        # Sets the library as a shared library.
        SHARED
 
        # Provides a relative path to your source file(s).
        src/main/cpp/libyuv.c
        src/main/cpp/apptimer.cpp
        src/main/cpp/charencode.cpp
        src/main/cpp/watermark.cpp
        src/main/cpp/ImageProc.c
        src/main/cpp/jpeg.c
        src/main/cpp/SonixCamera/ROMData.c
        src/main/cpp/SonixCamera/SFData.c
        src/main/cpp/SonixCamera/SonixCamera.c
        src/main/cpp/SonixCamera/XUOptDev.c
        )
 
 
 
find_library( # Sets the name of the path variable.
        log-lib
 
        log)
find_library( # Sets the name of the path variable.
        g-lib
 
 
        jnigraphics)
 
add_library(jpeg
        SHARED
        IMPORTED)
set_target_properties(jpeg
        PROPERTIES IMPORTED_LOCATION
        ${JNI_LIBS_DIR}/${ANDROID_ABI}/libjpeg.so)
 
add_library(turbojpeg
        SHARED
        IMPORTED)
set_target_properties(turbojpeg
        PROPERTIES IMPORTED_LOCATION
        ${JNI_LIBS_DIR}/${ANDROID_ABI}/libturbojpeg.so)
 
# 指定头文件的位置
include_directories(${JNI_LIBS_DIR}/includes)
 
target_link_libraries( # Specifies the target library.
        usbcamera-lib
 
        jpeg
        turbojpeg
        ${log-lib}
        ${g-lib}
        c++_shared
)
 
#target_link_libraries( # Specifies the target library.
#        usbcamera-lib
#
#        jpeg
#        turbojpeg
#        ${g-lib})