CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. set(the_description "WeChat QR code Detector")
  2. ocv_define_module(wechat_qrcode opencv_core opencv_imgproc opencv_dnn WRAP java objc python js)
  3. # iconv support isn't automatic on some systems
  4. if(CMAKE_VERSION VERSION_GREATER "3.11")
  5. find_package(Iconv QUIET)
  6. if(Iconv_FOUND)
  7. ocv_target_link_libraries(${the_module} Iconv::Iconv)
  8. else()
  9. ocv_target_compile_definitions(${the_module} PRIVATE "NO_ICONV=1")
  10. endif()
  11. endif()
  12. # need to change
  13. set(wechat_qrcode_commit_hash "a8b69ccc738421293254aec5ddb38bd523503252")
  14. set(hash_detect_caffemodel "238e2b2d6f3c18d6c3a30de0c31e23cf")
  15. set(hash_detect_prototxt "6fb4976b32695f9f5c6305c19f12537d")
  16. set(hash_sr_caffemodel "cbfcd60361a73beb8c583eea7e8e6664")
  17. set(hash_sr_prototxt "69db99927a70df953b471daaba03fbef")
  18. set(model_types caffemodel prototxt)
  19. set(model_names detect sr)
  20. foreach(model_name ${model_names})
  21. foreach(model_type ${model_types})
  22. ocv_download(FILENAME ${model_name}.${model_type}
  23. HASH ${hash_${model_name}_${model_type}}
  24. URL
  25. "${OPENCV_WECHAT_QRCODE_URL}"
  26. "$ENV{OPENCV_WECHAT_QRCODE_URL}"
  27. "https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/${wechat_qrcode_commit_hash}/"
  28. DESTINATION_DIR "${CMAKE_BINARY_DIR}/downloads/wechat_qrcode"
  29. ID "wechat_qrcode"
  30. RELATIVE_URL
  31. STATUS res)
  32. if(NOT res)
  33. message(WARNING "WeChatQRCode: Can't get ${model_name} ${model_type} file for wechat qrcode.")
  34. endif()
  35. endforeach()
  36. endforeach()