Advertisement
Guest User

Untitled

a guest
Dec 10th, 2017
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1.  
  2. # Sets the minimum version of CMake required to build the native
  3. # library. You should either keep the default value or only pass a
  4. # value of 3.4.0 or lower.
  5.  
  6. cmake_minimum_required(VERSION 3.4.1)
  7.  
  8. # OpenCV stuff
  9. include_directories(D:/Dev/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include)
  10. add_library( lib_opencv SHARED IMPORTED )
  11. set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR} /libs/${ANDROID_ABI}/libopencv_java3.so)
  12. add_library( lib_qihan SHARED IMPORTED )
  13. set_target_properties(lib_qihan PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR} /libs/QihanOpenSDK_1.1.8.0.aar)
  14.  
  15. # Creates and names a library, sets it as either STATIC
  16. # or SHARED, and provides the relative paths to its source code.
  17. # You can define multiple libraries, and CMake builds it for you.
  18. # Gradle automatically packages shared libraries with your APK.
  19.  
  20. add_library( # Sets the name of the library.
  21. native-lib
  22.  
  23. # Sets the library as a shared library.
  24. SHARED
  25.  
  26. # Provides a relative path to your source file(s).
  27. # Associated headers in the same location as their source
  28. # file are automatically included.
  29. src/main/cpp/native-lib.cpp )
  30.  
  31.  
  32.  
  33. # Searches for a specified prebuilt library and stores the path as a
  34. # variable. Because system libraries are included in the search path by
  35. # default, you only need to specify the name of the public NDK library
  36. # you want to add. CMake verifies that the library exists before
  37. # completing its build.
  38.  
  39. find_library( # Sets the name of the path variable.
  40. log-lib
  41.  
  42. # Specifies the name of the NDK library that
  43. # you want CMake to locate.
  44. log )
  45.  
  46. # Specifies libraries CMake should link to your target library. You
  47. # can link multiple libraries, such as libraries you define in the
  48. # build script, prebuilt third-party libraries, or system libraries.
  49.  
  50. target_link_libraries( # Specifies the target library.
  51. native-lib
  52.  
  53. # OpenCV lib
  54. lib_opencv
  55.  
  56. # Robot SDK
  57. lib_qihan
  58.  
  59. # Links the target library to the log library
  60. # included in the NDK.
  61. ${log-lib} )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement