cmake: fix pkg-config handling

backporting commit c9f3f4d1d3
pull/14430/head
Alexander Alekhin 6 years ago
parent 0023d8a106
commit 90c34c5c17
  1. 2
      CMakeLists.txt
  2. 2
      cmake/OpenCVUtils.cmake

@ -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)

Loading…
Cancel
Save