vcpkg/ports/openmvg/fix-coinutils.patch

48 lines
1.9 KiB
Diff
Raw Normal View History

diff --git a/src/openMVG/linearProgramming/CMakeLists.txt b/src/openMVG/linearProgramming/CMakeLists.txt
index cc5212fda..0fb59c44c 100644
--- a/src/openMVG/linearProgramming/CMakeLists.txt
+++ b/src/openMVG/linearProgramming/CMakeLists.txt
@@ -16,8 +16,8 @@ target_link_libraries(openMVG_linearProgramming
openMVG_numeric
PRIVATE
${CLP_LIBRARIES} # clp + solver wrapper
- ${COINUTILS_LIBRARY} # container tools
- ${OSI_LIBRARY} # generic LP
+ ${COINUTILS_LIBRARIES} # container tools
+ ${OSI_LIBRARIES} # generic LP
)
target_include_directories(openMVG_linearProgramming
diff --git a/src/cmakeFindModules/FindCoinUtils.cmake b/src/cmakeFindModules/FindCoinUtils.cmake
index 5b64ce14c..595fb7dc8 100644
--- a/src/cmakeFindModules/FindCoinUtils.cmake
+++ b/src/cmakeFindModules/FindCoinUtils.cmake
@@ -57,6 +57,12 @@ IF(EXISTS "${COINUTILS_DIR}" AND NOT "${COINUTILS_DIR}" STREQUAL "")
SET(COINUTILS_LIBRARIES ${COINUTILS_LIBRARY})
ENDIF()
+ if(NOT WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(CoinUtils coinutils IMPORTED_TARGET)
+ list(APPEND COINUTILS_LIBRARIES PkgConfig::CoinUtils)
+ endif()
+
MESSAGE(STATUS "CoinUtils ${COINUTILS_VERSION} found (include: ${COINUTILS_INCLUDE_DIRS})")
ELSE()
MESSAGE(STATUS "You are attempting to build without CoinUtils. "
diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in
index d4ae73d1a..87f71cd7d 100644
--- a/src/cmakeFindModules/OpenMVGConfig.cmake.in
+++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in
@@ -65,6 +65,10 @@ find_dependency(Threads)
find_dependency(cereal)
find_dependency(Ceres)
find_dependency(vlfeat)
+if(NOT WIN32)
+ find_dependency(PkgConfig)
+ pkg_check_modules(CoinUtils coinutils IMPORTED_TARGET)
+endif()
# Build the absolute root install directory as a relative path
get_filename_component(CURRENT_ROOT_INSTALL_DIR