CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # For more information about using CMake with Android Studio, read the
  2. # documentation: https://d.android.com/studio/projects/add-native-code.html
  3. # Sets the minimum version of CMake required to build the native library.
  4. cmake_minimum_required(VERSION 3.4.1)
  5. # Creates and names a library, sets it as either STATIC
  6. # or SHARED, and provides the relative paths to its source code.
  7. # You can define multiple libraries, and CMake builds them for you.
  8. # Gradle automatically packages shared libraries with your APK.
  9. #设置库文件的输出目录
  10. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../soLibs/comm/${ANDROID_ABI})
  11. include_directories(src/main/cpp/comm)
  12. #######################################
  13. # libdolin-comm.so
  14. #######################################
  15. aux_source_directory(src/main/cpp/comm COMM_SRC)
  16. #aux_source_directory(src/main/cpp/ DIR_SOURCE)
  17. #aux_source_directory(src/main/cpp/buffer DIR_SOURCE_BUFFER)
  18. #aux_source_directory(src/main/cpp/comm DIR_SOURCE_KIT)
  19. add_library(
  20. dolin-comm
  21. SHARED
  22. ${COMM_SRC}
  23. )
  24. # Searches for a specified prebuilt library and stores the path as a
  25. # variable. Because CMake includes system libraries in the search path by
  26. # default, you only need to specify the name of the public NDK library
  27. # you want to add. CMake verifies that the library exists before
  28. # completing its build.
  29. find_library( # Sets the name of the path variable.
  30. log-lib
  31. # Specifies the name of the NDK library that
  32. # you want CMake to locate.
  33. log)
  34. # Specifies libraries CMake should link to your target library. You
  35. # can link multiple libraries, such as libraries you define in this
  36. # build script, prebuilt third-party libraries, or system libraries.
  37. target_link_libraries( # Specifies the target library.
  38. dolin-comm
  39. # Links the target library to the log library
  40. # included in the NDK.
  41. ${log-lib})