Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ports/ceres/0002_use_glog_target.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt
index 3711222..8646bd0 100644
index 0e33263..299b373 100644
--- a/internal/ceres/CMakeLists.txt
+++ b/internal/ceres/CMakeLists.txt
@@ -174,17 +174,9 @@ endif (SCHUR_SPECIALIZATIONS)
@@ -101,17 +101,9 @@ endif()
find_package(Threads QUIET)
list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Threads::Threads)

-if (NOT MINIGLOG AND GLOG_FOUND)
- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES})
- if (gflags_FOUND)
Expand All @@ -21,5 +21,5 @@ index 3711222..8646bd0 100644
+ list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES glog::glog)
+endif (NOT MINIGLOG)

if (SUITESPARSE AND SUITESPARSE_FOUND)
if (SUITESPARSE AND SuiteSparse_FOUND)
# Define version information for use in Solver::FullReport.
14 changes: 7 additions & 7 deletions ports/ceres/0003_fix_exported_ceres_config.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
index e5e2976..be1083a 100644
index 4745483..b55462d 100644
--- a/cmake/CeresConfig.cmake.in
+++ b/cmake/CeresConfig.cmake.in
@@ -213,55 +213,13 @@ else (EIGEN3_FOUND)
endif (EIGEN3_FOUND)
@@ -217,55 +217,14 @@ else (Eigen3_FOUND)
endif (Eigen3_FOUND)

# glog (and maybe gflags).
-#
Expand Down Expand Up @@ -35,15 +35,15 @@ index e5e2976..be1083a 100644
- # Search quietly s/t we control the timing of the error message if not found.
- find_package(Glog QUIET)
- endif()
+include (CMakeFindDependencyMacro)
+find_dependency (glog NO_MODULE)

- if (GLOG_FOUND)
- ceres_message(STATUS "Found required Ceres dependency: glog")
- else()
- ceres_report_not_found("Missing required Ceres dependency: glog.")
- endif()
-
+include (CMakeFindDependencyMacro)
+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)
Expand All @@ -59,7 +59,7 @@ index e5e2976..be1083a 100644
-endif(CERES_USES_MINIGLOG)
+# SuiteSparse
+if (@SUITESPARSE@)
+ find_dependency(suitesparse CONFIG)
+ find_dependency(SuiteSparse)
+endif()

# Import exported Ceres targets, if they have not already been imported.
Expand Down
13 changes: 0 additions & 13 deletions ports/ceres/0004_fix_lib_path_linux.patch

This file was deleted.

93 changes: 69 additions & 24 deletions ports/ceres/find-package-required.patch
Original file line number Diff line number Diff line change
@@ -1,58 +1,103 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6a3d05..a78c027 100644
index 2d241fe..e1eadfb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -245,7 +245,7 @@ if (EIGEN3_FOUND)
endif (EIGEN3_FOUND)
@@ -244,7 +244,7 @@ else (CUDA)
endif (CUDA)

if (LAPACK)
- find_package(LAPACK QUIET)
+ find_package(LAPACK REQUIRED)
if (LAPACK_FOUND)
message("-- Found LAPACK library: ${LAPACK_LIBRARIES}")
else (LAPACK_FOUND)
@@ -263,7 +263,7 @@ if (SUITESPARSE)
@@ -266,7 +266,8 @@ if (SUITESPARSE)
# built with SuiteSparse support.

# Check for SuiteSparse and dependencies.
- find_package(SuiteSparse)
+ find_package(SuiteSparse REQUIRED)
if (SUITESPARSE_FOUND)
# On Ubuntu the system install of SuiteSparse (v3.4.0) up to at least
# Ubuntu 13.10 cannot be used to link shared libraries.
@@ -300,7 +300,7 @@ endif (SUITESPARSE)
- find_package(SuiteSparse 4.0 COMPONENTS CHOLMOD SPQR)
+ find_package(suitesparse CONFIG REQUIRED)
Comment thread
Adela0814 marked this conversation as resolved.
+ set(SuiteSparse_FOUND 1)
if (SuiteSparse_FOUND)
set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})")
# By default, if all of SuiteSparse's dependencies are found, Ceres is
@@ -274,7 +275,7 @@ if (SUITESPARSE)
message("-- Found SuiteSparse ${SuiteSparse_VERSION}, "
"building with SuiteSparse.")

- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR)
+ if (0)
install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake
${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
@@ -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)
if (CXSparse_FOUND)
set(CXSparse_DEPENDENCY "find_dependency(CXSparse ${CXSparse_VERSION})")
# By default, if CXSparse and all dependencies are found, Ceres is
# built with CXSparse support.
@@ -336,7 +336,7 @@ endif(NOT SUITESPARSE AND NOT CXSPARSE AND NOT EIGENSPARSE)
@@ -302,7 +303,7 @@ if (CXSPARSE)
message("-- Found CXSparse version: ${CXSparse_VERSION}, "
"building with CXSparse.")

- if (CXSparse_NO_CMAKE OR NOT CXSparse_DIR)
+ if (0)
install(FILES ${Ceres_SOURCE_DIR}/cmake/FindCXSparse.cmake
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
endif (CXSparse_NO_CMAKE OR NOT CXSparse_DIR)
@@ -367,9 +368,10 @@ endif()
# GFlags.
if (GFLAGS)
# Don't search with REQUIRED as we can continue without gflags.
- find_package(gflags 2.2.0)
+ find_package(gflags REQUIRED)
+ find_package(gflags CONFIG REQUIRED)
if (gflags_FOUND)
if (TARGET gflags)
- if (TARGET gflags)
+ if (TARGET gflags::gflags)
+ add_library(gflags ALIAS gflags::gflags)
message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}")
@@ -537,7 +537,7 @@ else (NOT OPENMP AND NOT TBB AND NOT CXX11_THREADS)
set_ceres_threading_model("${CERES_THREADING_MODEL}")
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)
- find_package(benchmark QUIET)
+ find_package(benchmark REQUIRED)
# 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()
@@ -782,7 +782,7 @@ if (BUILD_DOCUMENTATION)
set(CERES_DOCS_INSTALL_DIR "share/doc/ceres" CACHE STRING
"Ceres docs install path relative to CMAKE_INSTALL_PREFIX")
@@ -611,7 +613,7 @@ create_ceres_config("${CERES_COMPILE_OPTIONS}"
add_subdirectory(internal/ceres)

- find_package(Sphinx QUIET)
if (BUILD_DOCUMENTATION)
- find_package(Sphinx)
+ find_package(Sphinx REQUIRED)
if (NOT SPHINX_FOUND)
message("-- Failed to find Sphinx, disabling build of documentation.")
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
--- a/internal/ceres/CMakeLists.txt
+++ b/internal/ceres/CMakeLists.txt
@@ -108,14 +108,14 @@ endif (NOT MINIGLOG)
if (SUITESPARSE AND SuiteSparse_FOUND)
# Define version information for use in Solver::FullReport.
add_definitions(-DCERES_SUITESPARSE_VERSION="${SuiteSparse_VERSION}")
- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::CHOLMOD
- SuiteSparse::SPQR)
+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::cholmod
+ SuiteSparse::spqr)
endif (SUITESPARSE AND SuiteSparse_FOUND)

if (CXSPARSE AND CXSparse_FOUND)
# 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)

if (ACCELERATESPARSE AND AccelerateSparse_FOUND)
12 changes: 4 additions & 8 deletions ports/ceres/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ceres-solver/ceres-solver
REF 2.0.0
SHA512 6379666ef57af4ea85026644fa21365ce18fbaa12d50bd452bcdae0743a7b013effdd42c961e90c31815991bf315bd6904553dcc1a382ff5ed8c7abe9edf9a6c
REF 2.1.0
SHA512 b482988d837187e348250122b1acacbb4fd6354709efa6335c0322a68234a38292c072499a886b69a30614f85c818d3d2e9eeb3d3d0ca17d8f013a38d9151207
HEAD_REF master
PATCHES
0001_cmakelists_fixes.patch
0002_use_glog_target.patch
0003_fix_exported_ceres_config.patch
0004_fix_lib_path_linux.patch
find-package-required.patch
)

Expand All @@ -25,6 +24,7 @@ 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
Expand All @@ -51,11 +51,7 @@ vcpkg_cmake_configure(

vcpkg_cmake_install()

if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
else()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib${LIB_SUFFIX}/cmake/Ceres")
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib${LIB_SUFFIX}/cmake/Ceres")

vcpkg_copy_pdbs()

Expand Down
4 changes: 2 additions & 2 deletions ports/ceres/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ceres",
"version-semver": "2.0.0",
"port-version": 6,
"version": "2.1.0",
"description": "non-linear optimization package",
"homepage": "https://github.com/ceres-solver/ceres-solver",
"license": "Apache-2.0",
"dependencies": [
"eigen3",
"glog",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@
"port-version": 0
},
"ceres": {
"baseline": "2.0.0",
"port-version": 6
"baseline": "2.1.0",
"port-version": 0
},
"cfitsio": {
"baseline": "3.49",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/ceres.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b750afc30428d37f1afc48a561c658fcc27d01ca",
"version": "2.1.0",
"port-version": 0
},
{
"git-tree": "af54888fc010404793ba51c862147575c09a988b",
"version-semver": "2.0.0",
Expand Down