CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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}/../jniLibs/${ANDROID_ABI})
  10. aux_source_directory(src/main/cpp/ DIR_LIB_SOURCE)
  11. add_library(zege SHARED ${DIR_LIB_SOURCE})
  12. include_directories(src/main/cpp/includes)
  13. # Searches for a specified prebuilt library and stores the path as a
  14. # variable. Because CMake includes system libraries in the search path by
  15. # default, you only need to specify the name of the public NDK library
  16. # you want to add. CMake verifies that the library exists before
  17. # completing its build.
  18. find_library( # Sets the name of the path variable.
  19. log-lib
  20. # Specifies the name of the NDK library that
  21. # you want CMake to locate.
  22. log)
  23. # Specifies libraries CMake should link to your target library. You
  24. # can link multiple libraries, such as libraries you define in this
  25. # build script, prebuilt third-party libraries, or system libraries.
  26. target_link_libraries( # Specifies the target library.
  27. zege
  28. # Links the target library to the log library
  29. # included in the NDK.
  30. ${log-lib})