CMakeLists.txt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/include)
  10. #include_directories(src/main/cpp/json)
  11. #include_directories(src/main/cpp/encrypt)
  12. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/ DIR_SOURCE)
  13. #aux_source_directory(src/main/cpp/json JSON_SOURCE)
  14. #aux_source_directory(src/main/cpp/encrypt ENCRYPT_SOURCE)
  15. add_library(local_crypto STATIC IMPORTED)
  16. add_library(local_openssl STATIC IMPORTED)
  17. set_target_properties(local_crypto PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libs/${ANDROID_ABI}/libcrypto.a)
  18. set_target_properties(local_openssl PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libs/${ANDROID_ABI}/libssl.a)
  19. add_library(
  20. columbus
  21. SHARED
  22. ${DIR_SOURCE}
  23. # ${JSON_SOURCE}
  24. # ${ENCRYPT_SOURCE}
  25. )
  26. # Searches for a specified prebuilt library and stores the path as a
  27. # variable. Because CMake includes system libraries in the search path by
  28. # default, you only need to specify the name of the public NDK library
  29. # you want to add. CMake verifies that the library exists before
  30. # completing its build.
  31. find_library( # Sets the name of the path variable.
  32. log-lib
  33. # Specifies the name of the NDK library that
  34. # you want CMake to locate.
  35. log)
  36. # Specifies libraries CMake should link to your target library. You
  37. # can link multiple libraries, such as libraries you define in this
  38. # build script, prebuilt third-party libraries, or system libraries.
  39. target_link_libraries( # Specifies the target library.
  40. columbus
  41. local_openssl
  42. local_crypto
  43. # Links the target library to the log library
  44. # included in the NDK.
  45. ${log-lib})