From 2285dc59060f3a52d0d83f550c103b7c4083b484 Mon Sep 17 00:00:00 2001 From: Cheney-Wang <850426846@qq.com> Date: Fri, 10 Nov 2023 00:59:09 -0800 Subject: [PATCH 1/4] [ceres] update to 2.2.0 --- ports/ceres/0002_use_glog_target.patch | 8 +- .../0003_fix_exported_ceres_config.patch | 79 ++++------- ports/ceres/find-package-required.patch | 131 ++++++++++-------- ports/ceres/portfile.cmake | 16 +-- ports/ceres/vcpkg.json | 17 +-- versions/baseline.json | 4 +- versions/c-/ceres.json | 5 + 7 files changed, 123 insertions(+), 137 deletions(-) diff --git a/ports/ceres/0002_use_glog_target.patch b/ports/ceres/0002_use_glog_target.patch index 01ac27d4aa1575..1dd69d319f75f6 100644 --- a/ports/ceres/0002_use_glog_target.patch +++ b/ports/ceres/0002_use_glog_target.patch @@ -1,10 +1,10 @@ diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt -index 0e33263..299b373 100644 +index f9fc241..0aaabe4 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt -@@ -101,17 +101,9 @@ endif() - find_package(Threads QUIET) - list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Threads::Threads) +@@ -85,17 +85,9 @@ endif (SCHUR_SPECIALIZATIONS) + set_source_files_properties(${CERES_INTERNAL_SCHUR_FILES} PROPERTIES + SKIP_UNITY_BUILD_INCLUSION ON) -if (NOT MINIGLOG AND GLOG_FOUND) - list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES}) diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index 9505707da17908..c84297bbf4ba46 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -1,65 +1,38 @@ diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in -index 4745483..b55462d 100644 +index ceb7e26..9ed95c9 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in -@@ -217,55 +217,14 @@ else (Eigen3_FOUND) +@@ -217,6 +217,7 @@ else (Eigen3_FOUND) endif (Eigen3_FOUND) # glog (and maybe gflags). --# --# Flags set during configuration and build of Ceres. --set(CERES_USES_MINIGLOG @MINIGLOG@) --set(CERES_GLOG_VERSION @glog_VERSION@) --set(CERES_GLOG_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION@) -- --set(CERES_USES_GFLAGS @GFLAGS@) --set(CERES_GFLAGS_VERSION @gflags_VERSION@) -- --if (CERES_USES_MINIGLOG) -- # Output message at standard log level (not the lower STATUS) so that -- # the message is output in GUI during configuration to warn user. -- ceres_message("-- Found Ceres compiled with miniglog substitute " -- "for glog, beware this will likely cause problems if glog is later linked.") --else(CERES_USES_MINIGLOG) -- if (CERES_GLOG_WAS_BUILT_WITH_CMAKE) -- find_package(glog ${CERES_GLOG_VERSION} CONFIG QUIET) -- set(GLOG_FOUND ${glog_FOUND}) -- else() -- # Version of glog against which Ceres was built was not built with CMake, -- # use the exported glog find_package() module from Ceres to find it again. -- # Append the locations of glog when Ceres was built to the search path hints. -- list(APPEND GLOG_INCLUDE_DIR_HINTS "@GLOG_INCLUDE_DIR@") -- get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR "@GLOG_LIBRARY@" PATH) -- list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR}) -- -- # Search quietly s/t we control the timing of the error message if not found. -- find_package(Glog QUIET) -- endif() - -- if (GLOG_FOUND) -- ceres_message(STATUS "Found required Ceres dependency: glog") -- else() -- ceres_report_not_found("Missing required Ceres dependency: glog.") -- endif() ++if(0) + # + # Flags set during configuration and build of Ceres. + set(CERES_USES_MINIGLOG @MINIGLOG@) +@@ -266,6 +267,26 @@ else(CERES_USES_MINIGLOG) + endif() + endif() + endif(CERES_USES_MINIGLOG) ++endif(0) ++ +include (CMakeFindDependencyMacro) ++find_dependency (Eigen3) +find_dependency (glog NO_MODULE) - -- # gflags is only a public dependency of Ceres via glog, thus is not required -- # if Ceres was built with MINIGLOG. -- if (CERES_USES_GFLAGS) -- # Search quietly s/t we control the timing of the error message if not found. -- find_package(gflags ${CERES_GFLAGS_VERSION} QUIET) -- if (gflags_FOUND AND TARGET gflags) -- ceres_message(STATUS "Found required Ceres dependency: gflags") -- else() -- ceres_report_not_found("Missing required Ceres " -- "dependency: gflags (not found, or not found as exported CMake target).") -- endif() -- endif() --endif(CERES_USES_MINIGLOG) -+# SuiteSparse ++if (@EIGENSPARSE@) ++ find_dependency (metis CONFIG) ++endif() +if (@SUITESPARSE@) -+ find_dependency(SuiteSparse CONFIG) ++ find_dependency(SuiteSparse CONFIG) ++endif() ++if (@LAPACK@) ++ find_dependency(LAPACK) ++endif() ++if (@USE_CUDA@) ++ find_dependency(CUDA) ++endif() ++if (@GFLAGS@) ++ find_dependency(gflags CONFIG) +endif() # Import exported Ceres targets, if they have not already been imported. diff --git a/ports/ceres/find-package-required.patch b/ports/ceres/find-package-required.patch index 07785dd137e521..e89f0690473b85 100644 --- a/ports/ceres/find-package-required.patch +++ b/ports/ceres/find-package-required.patch @@ -1,9 +1,9 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2d241fe..b79454d 100644 +index 3a0debc..bf57bdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -244,7 +244,7 @@ else (CUDA) - endif (CUDA) +@@ -270,7 +270,7 @@ if (NOT USE_CUDA) + endif (NOT USE_CUDA) if (LAPACK) - find_package(LAPACK QUIET) @@ -11,17 +11,18 @@ index 2d241fe..b79454d 100644 if (LAPACK_FOUND) message("-- Found LAPACK library: ${LAPACK_LIBRARIES}") else (LAPACK_FOUND) -@@ -266,7 +266,8 @@ if (SUITESPARSE) +@@ -292,27 +292,26 @@ if (SUITESPARSE) # built with SuiteSparse support. # Check for SuiteSparse and dependencies. -- find_package(SuiteSparse 4.0 COMPONENTS CHOLMOD SPQR) +- find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR +- OPTIONAL_COMPONENTS Partition) +- if (SuiteSparse_FOUND) + find_package(suitesparse CONFIG REQUIRED) -+ set(SuiteSparse_FOUND 1) - if (SuiteSparse_FOUND) ++ if (suitesparse_FOUND) set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") # By default, if all of SuiteSparse's dependencies are found, Ceres is -@@ -274,11 +275,11 @@ if (SUITESPARSE) + # built with SuiteSparse support. message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " "building with SuiteSparse.") @@ -31,33 +32,50 @@ index 2d241fe..b79454d 100644 ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) +- else (SuiteSparse_FOUND) + endif () - else (SuiteSparse_FOUND) ++ else (suitesparse_FOUND) # Disable use of SuiteSparse if it cannot be found and continue. message("-- Did not find all SuiteSparse dependencies, disabling " -@@ -294,7 +295,7 @@ endif (SUITESPARSE) - # CXSparse. - if (CXSPARSE) - # Don't search with REQUIRED as we can continue without CXSparse. -- find_package(CXSparse) -+ find_package(CXSparse REQUIRED) - if (CXSparse_FOUND) - set(CXSparse_DEPENDENCY "find_dependency(CXSparse ${CXSparse_VERSION})") - # By default, if CXSparse and all dependencies are found, Ceres is -@@ -302,10 +303,10 @@ if (CXSPARSE) - message("-- Found CXSparse version: ${CXSparse_VERSION}, " - "building with CXSparse.") + "SuiteSparse support.") + update_cache_variable(SUITESPARSE OFF) + list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) +- endif (SuiteSparse_FOUND) ++ endif (suitesparse_FOUND) + else (SUITESPARSE) + message("-- Building without SuiteSparse.") + list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) +@@ -323,23 +322,23 @@ if (NOT SuiteSparse_Partition_FOUND) + endif (NOT SuiteSparse_Partition_FOUND) -- if (CXSparse_NO_CMAKE OR NOT CXSparse_DIR) + if (EIGENMETIS) +- find_package (METIS) +- if (METIS_FOUND) ++ find_package(metis CONFIG REQUIRED) ++ if (metis_FOUND) + # Since METIS is a private dependency of Ceres, it requires access to the + # link-only METIS::METIS target to avoid undefined linker errors in projects + # relying on Ceres. We do not actually need to propagate anything besides + # the link libraries (such as include directories.) + set(METIS_DEPENDENCY "find_dependency(METIS ${METIS_VERSION})") + # METIS find module must be installed unless a package config is being used. +- if (NOT METIS_DIR) + if (0) - install(FILES ${Ceres_SOURCE_DIR}/cmake/FindCXSparse.cmake + install(FILES ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) -- endif (CXSparse_NO_CMAKE OR NOT CXSparse_DIR) -+ endif () - else (CXSparse_FOUND) - # Disable use of CXSparse if it cannot be found and continue. - message("-- Did not find CXSparse, Building without CXSparse.") -@@ -367,9 +368,10 @@ endif() +- endif (NOT METIS_DIR) +- else (METIS_FOUND) ++ endif (0) ++ else (metis_FOUND) + message("-- Did not find METIS, disabling Eigen METIS support.") + update_cache_variable(EIGENMETIS OFF) + list (APPEND CERES_COMPILE_OPTIONS CERES_NO_EIGEN_METIS) +- endif (METIS_FOUND) ++ endif (metis_FOUND) + else (EIGENMETIS) + message("-- Building without Eigen METIS support.") + list (APPEND CERES_COMPILE_OPTIONS CERES_NO_EIGEN_METIS) +@@ -395,9 +394,9 @@ endif() # GFlags. if (GFLAGS) # Don't search with REQUIRED as we can continue without gflags. @@ -66,33 +84,14 @@ index 2d241fe..b79454d 100644 if (gflags_FOUND) - if (TARGET gflags) + if (TARGET gflags::gflags) -+ add_library(gflags ALIAS gflags::gflags) message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") else() message("-- Detected version of gflags: ${gflags_VERSION} does not define " -@@ -420,7 +422,7 @@ set_ceres_threading_model("${CERES_THREADING_MODEL}") - - if (BUILD_BENCHMARKS) - # Version 1.3 was first to provide import targets -- find_package(benchmark 1.3 QUIET) -+ find_package(benchmark CONFIG REQUIRED) - if (benchmark_FOUND) - message("-- Found Google benchmark library. Building Ceres benchmarks.") - else() -@@ -611,7 +613,7 @@ create_ceres_config("${CERES_COMPILE_OPTIONS}" - add_subdirectory(internal/ceres) - - if (BUILD_DOCUMENTATION) -- find_package(Sphinx) -+ find_package(Sphinx REQUIRED) - if (NOT SPHINX_FOUND) - message("-- Failed to find Sphinx and/or its dependencies, disabling build of documentation.") - update_cache_variable(BUILD_DOCUMENTATION OFF) diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt -index 299b373..33d41d8 100644 +index 0aaabe4..0035a70 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt -@@ -108,14 +108,14 @@ endif (NOT MINIGLOG) +@@ -92,8 +92,8 @@ endif (NOT MINIGLOG) if (SUITESPARSE AND SuiteSparse_FOUND) # Define version information for use in Solver::FullReport. add_definitions(-DCERES_SUITESPARSE_VERSION="${SuiteSparse_VERSION}") @@ -100,13 +99,33 @@ index 299b373..33d41d8 100644 - SuiteSparse::SPQR) + list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::cholmod + SuiteSparse::spqr) - endif (SUITESPARSE AND SuiteSparse_FOUND) - if (CXSPARSE AND CXSparse_FOUND) + if (SuiteSparse_Partition_FOUND) + list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::Partition) +@@ -103,7 +103,7 @@ endif (SUITESPARSE AND SuiteSparse_FOUND) + if (SuiteSparse_Partition_FOUND OR EIGENMETIS) # Define version information for use in Solver::FullReport. - add_definitions(-DCERES_CXSPARSE_VERSION="${CXSparse_VERSION}") -- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES CXSparse::CXSparse) -+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES ${CXSparse_LIBRARIES}) - endif (CXSPARSE AND CXSparse_FOUND) + add_definitions(-DCERES_METIS_VERSION="${METIS_VERSION}") +- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES METIS::METIS) ++ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES metis) + endif (SuiteSparse_Partition_FOUND OR EIGENMETIS) if (ACCELERATESPARSE AND AccelerateSparse_FOUND) +@@ -396,7 +396,7 @@ if (BUILD_TESTING AND GFLAGS) + if (CMAKE_SYSTEM_NAME MATCHES "QNX") + target_link_libraries(gtest PUBLIC regex) + endif() +- target_link_libraries(gtest PRIVATE Ceres::ceres gflags) ++ target_link_libraries(gtest PRIVATE Ceres::ceres gflags::gflags) + + add_library(test_util STATIC + evaluator_test_utils.cc +@@ -404,7 +404,7 @@ if (BUILD_TESTING AND GFLAGS) + test_util.cc) + + target_include_directories(test_util PUBLIC ${Ceres_SOURCE_DIR}/internal) +- target_link_libraries (test_util PUBLIC ceres_static gflags gtest) ++ target_link_libraries (test_util PUBLIC ceres_static gflags::gflags gtest) + + macro (CERES_TEST NAME) + add_executable(${NAME}_test ${NAME}_test.cc) diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 4249124a18ee2e..38249ad6c3282c 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -9,8 +9,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ceres-solver/ceres-solver - REF f68321e7de8929fbcdb95dd42877531e64f72f66 #2.1.0 - SHA512 67bbd8a9385a40fe69d118fbc84da0fcc9aa1fbe14dd52f5403ed09686504213a1d931e95a1a0148d293b27ab5ce7c1d618fbf2e8fed95f2bbafab851a1ef449 + REF "${VERSION}" + SHA512 d4cefe5851e25bd3c7b76352092d8d549eb371af2e35a325736554c54fe58a3523658697c3e2d65af660fe6895ae3d96fe31bd1875870474fc4b6fed3bbdfae9 HEAD_REF master PATCHES 0001_cmakelists_fixes.patch @@ -19,21 +19,17 @@ vcpkg_from_github( find-package-required.patch ) -file(REMOVE "${SOURCE_PATH}/cmake/FindCXSparse.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindGflags.cmake") file(REMOVE "${SOURCE_PATH}/cmake/FindGlog.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindEigen.cmake") file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake") file(REMOVE "${SOURCE_PATH}/cmake/FindMETIS.cmake") vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES "suitesparse" SUITESPARSE - "cxsparse" CXSPARSE "lapack" LAPACK "eigensparse" EIGENSPARSE "tools" GFLAGS - "cuda" CUDA + "cuda" USE_CUDA ) if(VCPKG_TARGET_IS_UWP) list(APPEND FEATURE_OPTIONS -DMINIGLOG=ON) @@ -58,10 +54,12 @@ vcpkg_cmake_configure( -DBUILD_BENCHMARKS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DBUILD_BENCHMARKS=OFF -DPROVIDE_UNINSTALL_TARGET=OFF -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} -DLIB_SUFFIX=${LIB_SUFFIX} + MAYBE_UNUSED_VARIABLES + MSVC_USE_STATIC_CRT + LIB_SUFFIX ) vcpkg_cmake_install() @@ -73,4 +71,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/ceres/vcpkg.json b/ports/ceres/vcpkg.json index d1bc27e5350660..656e8c3056730f 100644 --- a/ports/ceres/vcpkg.json +++ b/ports/ceres/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ceres", - "version": "2.1.0", - "port-version": 4, + "version": "2.2.0", "description": "non-linear optimization package", "homepage": "https://github.com/ceres-solver/ceres-solver", "license": "Apache-2.0", @@ -28,20 +27,12 @@ "cuda" ] }, - "cxsparse": { - "description": "CXSparse support for Ceres", + "eigensparse": { + "description": "Use of Eigen as a sparse linear algebra library in Ceres", "dependencies": [ - { - "name": "ceres", - "features": [ - "suitesparse" - ] - } + "metis" ] }, - "eigensparse": { - "description": "Use of Eigen as a sparse linear algebra library in Ceres" - }, "lapack": { "description": "Use Lapack in Ceres", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index b71a0457e0ca7f..e465fa836c6e2d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1501,8 +1501,8 @@ "port-version": 1 }, "ceres": { - "baseline": "2.1.0", - "port-version": 4 + "baseline": "2.2.0", + "port-version": 0 }, "cfitsio": { "baseline": "3.49", diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index d1f36343f2bfa8..94059a6329947b 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a6488283ecd563274c216a18479a9ab4f4d59423", + "version": "2.2.0", + "port-version": 0 + }, { "git-tree": "b2ebeb85c8833b2631210c4b790204151e402981", "version": "2.1.0", From 846c4383a4bb322fdb0b77054934dd7ef65c6bfa Mon Sep 17 00:00:00 2001 From: Cheney-Wang <850426846@qq.com> Date: Thu, 16 Nov 2023 01:35:10 -0800 Subject: [PATCH 2/4] Apply suggestion --- ports/ceres/find-package-required.patch | 42 +++++++------------------ versions/c-/ceres.json | 2 +- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/ports/ceres/find-package-required.patch b/ports/ceres/find-package-required.patch index e89f0690473b85..124e2ef2d44a1e 100644 --- a/ports/ceres/find-package-required.patch +++ b/ports/ceres/find-package-required.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3a0debc..bf57bdf 100644 +index 3a0debc..6997dac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,7 +270,7 @@ if (NOT USE_CUDA) @@ -11,18 +11,17 @@ index 3a0debc..bf57bdf 100644 if (LAPACK_FOUND) message("-- Found LAPACK library: ${LAPACK_LIBRARIES}") else (LAPACK_FOUND) -@@ -292,27 +292,26 @@ if (SUITESPARSE) +@@ -292,8 +292,7 @@ if (SUITESPARSE) # built with SuiteSparse support. # Check for SuiteSparse and dependencies. - find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR - OPTIONAL_COMPONENTS Partition) -- if (SuiteSparse_FOUND) -+ find_package(suitesparse CONFIG REQUIRED) -+ if (suitesparse_FOUND) ++ find_package(SuiteSparse NAMES suitesparse REQUIRED) + if (SuiteSparse_FOUND) set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") # By default, if all of SuiteSparse's dependencies are found, Ceres is - # built with SuiteSparse support. +@@ -301,11 +300,11 @@ if (SUITESPARSE) message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " "building with SuiteSparse.") @@ -32,30 +31,20 @@ index 3a0debc..bf57bdf 100644 ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR) -- else (SuiteSparse_FOUND) + endif () -+ else (suitesparse_FOUND) + else (SuiteSparse_FOUND) # Disable use of SuiteSparse if it cannot be found and continue. message("-- Did not find all SuiteSparse dependencies, disabling " - "SuiteSparse support.") - update_cache_variable(SUITESPARSE OFF) - list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) -- endif (SuiteSparse_FOUND) -+ endif (suitesparse_FOUND) - else (SUITESPARSE) - message("-- Building without SuiteSparse.") - list(APPEND CERES_COMPILE_OPTIONS CERES_NO_SUITESPARSE) -@@ -323,23 +322,23 @@ if (NOT SuiteSparse_Partition_FOUND) +@@ -323,7 +322,7 @@ if (NOT SuiteSparse_Partition_FOUND) endif (NOT SuiteSparse_Partition_FOUND) if (EIGENMETIS) - find_package (METIS) -- if (METIS_FOUND) -+ find_package(metis CONFIG REQUIRED) -+ if (metis_FOUND) ++ find_package(METIS NAMES metis REQUIRED) + if (METIS_FOUND) # Since METIS is a private dependency of Ceres, it requires access to the # link-only METIS::METIS target to avoid undefined linker errors in projects - # relying on Ceres. We do not actually need to propagate anything besides +@@ -331,10 +330,10 @@ if (EIGENMETIS) # the link libraries (such as include directories.) set(METIS_DEPENDENCY "find_dependency(METIS ${METIS_VERSION})") # METIS find module must be installed unless a package config is being used. @@ -64,17 +53,10 @@ index 3a0debc..bf57bdf 100644 install(FILES ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) - endif (NOT METIS_DIR) -- else (METIS_FOUND) -+ endif (0) -+ else (metis_FOUND) ++ endif () + else (METIS_FOUND) message("-- Did not find METIS, disabling Eigen METIS support.") update_cache_variable(EIGENMETIS OFF) - list (APPEND CERES_COMPILE_OPTIONS CERES_NO_EIGEN_METIS) -- endif (METIS_FOUND) -+ endif (metis_FOUND) - else (EIGENMETIS) - message("-- Building without Eigen METIS support.") - list (APPEND CERES_COMPILE_OPTIONS CERES_NO_EIGEN_METIS) @@ -395,9 +394,9 @@ endif() # GFlags. if (GFLAGS) diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index 94059a6329947b..11b21c44e38eea 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "a6488283ecd563274c216a18479a9ab4f4d59423", + "git-tree": "ffd3420a5e1b15b273c26511914636ea6e7940b1", "version": "2.2.0", "port-version": 0 }, From ebf9d7f8a8eb3c04cc5d7160224bc330687a76c6 Mon Sep 17 00:00:00 2001 From: Cheney-Wang <850426846@qq.com> Date: Tue, 21 Nov 2023 23:16:29 -0800 Subject: [PATCH 3/4] Apply suggestion - 2 --- .../0003_fix_exported_ceres_config.patch | 2 +- ports/ceres/find-package-required.patch | 30 ------------------- versions/c-/ceres.json | 2 +- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index c84297bbf4ba46..2e515591f6d44c 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -32,7 +32,7 @@ index ceb7e26..9ed95c9 100644 + find_dependency(CUDA) +endif() +if (@GFLAGS@) -+ find_dependency(gflags CONFIG) ++ find_dependency(gflags) +endif() # Import exported Ceres targets, if they have not already been imported. diff --git a/ports/ceres/find-package-required.patch b/ports/ceres/find-package-required.patch index 124e2ef2d44a1e..93cbbbe3415e75 100644 --- a/ports/ceres/find-package-required.patch +++ b/ports/ceres/find-package-required.patch @@ -57,18 +57,6 @@ index 3a0debc..6997dac 100644 else (METIS_FOUND) message("-- Did not find METIS, disabling Eigen METIS support.") update_cache_variable(EIGENMETIS OFF) -@@ -395,9 +394,9 @@ endif() - # GFlags. - if (GFLAGS) - # Don't search with REQUIRED as we can continue without gflags. -- find_package(gflags 2.2.0) -+ find_package(gflags CONFIG REQUIRED) - if (gflags_FOUND) -- if (TARGET gflags) -+ if (TARGET gflags::gflags) - message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}") - else() - message("-- Detected version of gflags: ${gflags_VERSION} does not define " diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt index 0aaabe4..0035a70 100644 --- a/internal/ceres/CMakeLists.txt @@ -93,21 +81,3 @@ index 0aaabe4..0035a70 100644 endif (SuiteSparse_Partition_FOUND OR EIGENMETIS) if (ACCELERATESPARSE AND AccelerateSparse_FOUND) -@@ -396,7 +396,7 @@ if (BUILD_TESTING AND GFLAGS) - if (CMAKE_SYSTEM_NAME MATCHES "QNX") - target_link_libraries(gtest PUBLIC regex) - endif() -- target_link_libraries(gtest PRIVATE Ceres::ceres gflags) -+ target_link_libraries(gtest PRIVATE Ceres::ceres gflags::gflags) - - add_library(test_util STATIC - evaluator_test_utils.cc -@@ -404,7 +404,7 @@ if (BUILD_TESTING AND GFLAGS) - test_util.cc) - - target_include_directories(test_util PUBLIC ${Ceres_SOURCE_DIR}/internal) -- target_link_libraries (test_util PUBLIC ceres_static gflags gtest) -+ target_link_libraries (test_util PUBLIC ceres_static gflags::gflags gtest) - - macro (CERES_TEST NAME) - add_executable(${NAME}_test ${NAME}_test.cc) diff --git a/versions/c-/ceres.json b/versions/c-/ceres.json index 11b21c44e38eea..bbda22de554f02 100644 --- a/versions/c-/ceres.json +++ b/versions/c-/ceres.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "ffd3420a5e1b15b273c26511914636ea6e7940b1", + "git-tree": "8b88d8faef984aaa9604acd4c2d667ad1ac34566", "version": "2.2.0", "port-version": 0 }, From ed00c29647e315e34ef2a0af8dca26354198a533 Mon Sep 17 00:00:00 2001 From: Cheney-Wang <850426846@qq.com> Date: Wed, 22 Nov 2023 00:08:10 -0800 Subject: [PATCH 4/4] Remove non-existent dependencies --- ports/openmvg/vcpkg.json | 3 +-- versions/baseline.json | 2 +- versions/o-/openmvg.json | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/openmvg/vcpkg.json b/ports/openmvg/vcpkg.json index 4a22b21f25278e..3827b6cc842b82 100644 --- a/ports/openmvg/vcpkg.json +++ b/ports/openmvg/vcpkg.json @@ -1,7 +1,7 @@ { "name": "openmvg", "version": "2.0", - "port-version": 9, + "port-version": 10, "description": "open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.", "license": "MPL-2.0-no-copyleft-exception", "supports": "(x86 | x64 | arm64) & !xbox", @@ -10,7 +10,6 @@ { "name": "ceres", "features": [ - "cxsparse", "suitesparse" ] }, diff --git a/versions/baseline.json b/versions/baseline.json index cbbd3ec4c309d7..e976d79b282175 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6270,7 +6270,7 @@ }, "openmvg": { "baseline": "2.0", - "port-version": 9 + "port-version": 10 }, "openmvs": { "baseline": "2.1.0", diff --git a/versions/o-/openmvg.json b/versions/o-/openmvg.json index e1a853297bcd3d..9b438d88d161f0 100644 --- a/versions/o-/openmvg.json +++ b/versions/o-/openmvg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "da716bd3be4f20bd96fd253e86dae2e99abd0933", + "version": "2.0", + "port-version": 10 + }, { "git-tree": "6ddaa3bedcc57eb498c9e180bb8546a2726a1ddc", "version": "2.0",