CMakeLists.txt 859 B

123456789101112131415161718192021222324252627
  1. set(sample example-tutorial-4-opencl)
  2. if(NOT DEFINED ANDROID_OPENCL_SDK)
  3. message(STATUS "Sample ${sample} is disabled, because ANDROID_OPENCL_SDK is not specified")
  4. return()
  5. endif()
  6. if(ANDROID_NATIVE_API_LEVEL LESS 14)
  7. message(STATUS "Sample ${sample} is disabled, because ANDROID_NATIVE_API_LEVEL < 14")
  8. return()
  9. endif()
  10. if(BUILD_FAT_JAVA_LIB)
  11. set(native_deps opencv_java)
  12. else()
  13. set(native_deps opencv_imgproc)
  14. endif()
  15. include_directories(${ANDROID_OPENCL_SDK}/include)
  16. link_directories(${ANDROID_OPENCL_SDK}/lib/${ANDROID_NDK_ABI_NAME})
  17. add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}"
  18. LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}"
  19. SDK_TARGET 21 "${ANDROID_SDK_TARGET}"
  20. NATIVE_DEPS ${native_deps} -lGLESv2 -lEGL -lOpenCL
  21. COPY_LIBS YES
  22. )
  23. if(TARGET ${sample})
  24. add_dependencies(opencv_android_examples ${sample})
  25. endif()