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})