Commit 90c34c5c authored by Alexander Alekhin's avatar Alexander Alekhin

cmake: fix pkg-config handling

backporting commit c9f3f4d1
parent 0023d8a1
......@@ -719,7 +719,7 @@ ocv_cmake_hook(POST_COMPILER_OPTIONS)
# ----------------------------------------------------------------------------
if(UNIX)
if(NOT APPLE_FRAMEWORK OR OPENCV_ENABLE_PKG_CONFIG)
if(CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG_LIBDIR}
if(CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG_LIBDIR} AND NOT DEFINED ENV{PKG_CONFIG_SYSROOT_DIR}
AND NOT OPENCV_ENABLE_PKG_CONFIG
)
if(NOT PkgConfig_FOUND)
......
......@@ -743,7 +743,7 @@ macro(ocv_check_modules define)
endif()
unset(${define}_${__modname}_FOUND)
endforeach()
if(COMMAND pkg_check_modules)
if(PKG_CONFIG_FOUND OR PkgConfig_FOUND)
pkg_check_modules(${define} ${ARGN})
endif()
if(${define}_FOUND)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment