mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 22:19:14 +08:00
cmake: avoid using of pkg-config in cross-compilation mode unconditionally
- specify PKG_CONFIG_LIBDIR environment variable to new target SYSROOT
This commit is contained in:
parent
98bd0a06dc
commit
c4f9ff0285
@ -552,8 +552,22 @@ endif(WIN32 AND NOT MINGW)
|
||||
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
|
||||
# ----------------------------------------------------------------------------
|
||||
if(UNIX)
|
||||
if(NOT APPLE_FRAMEWORK)
|
||||
find_package(PkgConfig QUIET)
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user