diff --git a/modules/wechat_qrcode/CMakeLists.txt b/modules/wechat_qrcode/CMakeLists.txt index 210f4a0d50a..d38d9cce755 100644 --- a/modules/wechat_qrcode/CMakeLists.txt +++ b/modules/wechat_qrcode/CMakeLists.txt @@ -1,6 +1,16 @@ set(the_description "WeChat QR code Detector") ocv_define_module(wechat_qrcode opencv_core opencv_imgproc opencv_dnn WRAP java objc python js) +# iconv support isn't automatic on some systems +if(CMAKE_VERSION VERSION_GREATER "3.11") + find_package(Iconv QUIET) + if(Iconv_FOUND) + ocv_target_link_libraries(${the_module} Iconv::Iconv) + else() + ocv_target_compile_definitions(${the_module} PRIVATE "NO_ICONV=1") + endif() +endif() + # need to change set(wechat_qrcode_commit_hash "a8b69ccc738421293254aec5ddb38bd523503252") set(hash_detect_caffemodel "238e2b2d6f3c18d6c3a30de0c31e23cf") diff --git a/modules/wechat_qrcode/src/zxing/zxing.hpp b/modules/wechat_qrcode/src/zxing/zxing.hpp index 11090f74b95..76efae22c87 100644 --- a/modules/wechat_qrcode/src/zxing/zxing.hpp +++ b/modules/wechat_qrcode/src/zxing/zxing.hpp @@ -27,7 +27,7 @@ #define USE_ONED_WRITER 1 #endif -#if defined(__ANDROID_API__) || defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(__ANDROID_API__) || defined(_MSC_VER) #ifndef NO_ICONV #define NO_ICONV