Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2026-04-29 16:36:02 +03:00
73 changed files with 1718 additions and 1112 deletions
+54 -26
View File
@@ -127,43 +127,71 @@ if(HAVE_EIGEN)
endif()
endif()
# --- Clp ---
# Ubuntu: sudo apt-get install coinor-libclp-dev coinor-libcoinutils-dev
ocv_clear_vars(HAVE_CLP)
if(WITH_CLP)
if(UNIX)
ocv_check_modules(CLP clp)
if(CLP_FOUND)
set(HAVE_CLP TRUE)
if(NOT ${CLP_INCLUDE_DIRS} STREQUAL "")
ocv_include_directories(${CLP_INCLUDE_DIRS})
if(WITH_CLP AND NOT ANDROID AND NOT IOS)
# 1. Modern CMake config (vcpkg / system packages)
find_package(Clp CONFIG QUIET)
if(Clp_FOUND AND TARGET Coin::Clp AND TARGET Coin::CoinUtils)
set(HAVE_CLP 1)
list(APPEND OPENCV_LINKER_LIBS Coin::Clp Coin::CoinUtils)
endif()
# 2. pkg-config fallback (Unix)
if(NOT HAVE_CLP AND UNIX)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(CLP QUIET clp)
if(CLP_FOUND)
set(HAVE_CLP 1)
ocv_include_directories(SYSTEM ${CLP_INCLUDE_DIRS})
list(APPEND OPENCV_LINKER_LIBS ${CLP_LIBRARIES})
endif()
list(APPEND OPENCV_LINKER_LIBS ${CLP_LIBRARIES})
endif()
endif()
if(NOT CLP_FOUND)
find_path(CLP_INCLUDE_PATH "coin"
PATHS "/usr/local/include" "/usr/include" "/opt/include"
DOC "The path to Clp headers")
# 3. Manual fallback (last resort)
if(NOT HAVE_CLP)
find_path(CLP_INCLUDE_PATH
NAMES coin/ClpSimplex.hpp
PATHS /usr/include /usr/local/include /opt/include
DOC "The path to Clp headers"
)
if(CLP_INCLUDE_PATH)
ocv_include_directories(${CLP_INCLUDE_PATH} "${CLP_INCLUDE_PATH}/coin")
get_filename_component(_CLP_LIBRARY_DIR "${CLP_INCLUDE_PATH}/../lib" ABSOLUTE)
set(CLP_LIBRARY_DIR "${_CLP_LIBRARY_DIR}" CACHE PATH "Full path of Clp library directory")
link_directories(${CLP_LIBRARY_DIR})
if(UNIX)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils m)
else()
if(MINGW)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils)
else()
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} libClp libCoinUtils)
# Support both:
# /usr/include/coin/ClpSimplex.hpp
# /usr/local/include/ClpSimplex.hpp + /coin
ocv_include_directories(
${CLP_INCLUDE_PATH}
"${CLP_INCLUDE_PATH}/coin"
)
find_library(CLP_LIBRARY
NAMES Clp libClp
)
find_library(COINUTILS_LIBRARY
NAMES CoinUtils libCoinUtils
)
if(CLP_LIBRARY AND COINUTILS_LIBRARY)
set(HAVE_CLP 1)
list(APPEND OPENCV_LINKER_LIBS
${CLP_LIBRARY}
${COINUTILS_LIBRARY}
)
if(UNIX)
list(APPEND OPENCV_LINKER_LIBS m)
endif()
endif()
set(HAVE_CLP TRUE)
endif()
endif()
endif(WITH_CLP)
endif()
# --- ARM KleidiCV
if(WITH_KLEIDICV)
@@ -217,4 +245,4 @@ if(WITH_FASTCV)
set(HAVE_FASTCV FALSE CACHE BOOL "FastCV status")
endif()
endif()
endif(WITH_FASTCV)
endif(WITH_FASTCV)