CMakeLists.txt 2.6 KB

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