message: cmake: avoid using of pkg-config in cross-compilation mode unconditionally
  specify PKG_CONFIG_LIBDIR environment variable to new target SYSROOT
diff: @@ -552,9 +552,23 @@ endif(WIN32 AND NOT MINGW)
  # CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
  # ----------------------------------------------------------------------------
  if(UNIX)
  - if(NOT APPLE_FRAMEWORK)
  + if(NOT APPLE_FRAMEWORK OR OPENCV_ENABLE_PKG_CONFIG)
  + if(CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG_LIBDIR}
  + AND NOT OPENCV_ENABLE_PKG_CONFIG
  + )
  + if(NOT PkgConfig_FOUND)
  + message(STATUS "OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target SYSROOT")
  + elseif(OPENCV_SKIP_PKG_CONFIG_WARNING)
  + message(WARNING "pkg-config is enabled in cross-compilation mode without defining of PKG_CONFIG_LIBDIR environment variable. This may lead to misconfigured host-based dependencies.")
  + endif()
  + elseif(OPENCV_DISABLE_PKG_CONFIG)
  + if(PkgConfig_FOUND)
  + message(WARNING "OPENCV_DISABLE_PKG_CONFIG flag has no effect")
  + endif()
  + else()
  find_package(PkgConfig QUIET)
  endif()
  + endif()
  include(CheckFunctionExists)
  include(CheckIncludeFile)
  include(CheckSymbolExists)
  