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. serial_port
  12. # Sets the library as a shared library.
  13. SHARED
  14. # Provides a relative path to your source file(s).
  15. src/main/cpp/SerialPort.c )
  16. find_library( # Sets the name of the path variable.
  17. log-lib
  18. # Specifies the name of the NDK library that
  19. # you want CMake to locate.
  20. log )
  21. # Specifies libraries CMake should link to your target library. You
  22. # can link multiple libraries, such as libraries you define in this
  23. # build script, prebuilt third-party libraries, or system libraries.
  24. target_link_libraries( # Specifies the target library.
  25. serial_port
  26. # Links the target library to the log library
  27. # included in the NDK.
  28. ${log-lib} )