CMakeLists.txt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Sets the minimum version of CMake required to build your native library.
  2. # This ensures that a certain set of CMake features is available to
  3. # your build.
  4. cmake_minimum_required(VERSION 3.4.1)
  5. # Specifies a library name, specifies whether the library is STATIC or
  6. # SHARED, and provides relative paths to the source code. You can
  7. # define multiple libraries by adding multiple add.library() commands,
  8. # and CMake builds them for you. When you build your app, Gradle
  9. # automatically packages shared libraries with your APK.
  10. add_library( # Specifies the name of the library.
  11. native-lib
  12. # Sets the library as a shared library.
  13. SHARED
  14. # Provides a relative path to your source file(s).
  15. src/main/cpp/native-lib.cpp )
  16. # Specifies a path to native header files.
  17. include_directories(src/main/cpp/include/)
  18. find_library( # Defines the name of the path variable that stores the
  19. # location of the NDK library.
  20. log-lib
  21. # Specifies the name of the NDK library that
  22. # CMake needs to locate.
  23. log )
  24. # Links your native library against one or more other native libraries.
  25. target_link_libraries( # Specifies the target library.
  26. native-lib
  27. # Links the log library to the target library.
  28. ${log-lib} )