diff --git a/ports/g2o/0003-dependency-spdlog.diff b/ports/g2o/0003-dependency-spdlog.diff new file mode 100644 index 00000000000000..b98e071bf9836a --- /dev/null +++ b/ports/g2o/0003-dependency-spdlog.diff @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c2b0a09b..2645ff66 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -177,7 +177,8 @@ find_package(QGLViewer) + option(G2O_USE_LOGGING "Try to use spdlog for logging" ON) + set(G2O_HAVE_LOGGING 0) + if (G2O_USE_LOGGING) +- find_package(spdlog 1.6 QUIET) ++ find_package(spdlog 1.6 REQUIRED CONFIG) ++ set(G2O_HAVE_LOGGING 1) + if (TARGET spdlog::spdlog OR TARGET spdlog::spdlog_header_only) + set(G2O_HAVE_LOGGING 1) + message(STATUS "Compiling with logging support") diff --git a/ports/g2o/portfile.cmake b/ports/g2o/portfile.cmake index a14e0d6715b59e..c6ef1910448ce5 100644 --- a/ports/g2o/portfile.cmake +++ b/ports/g2o/portfile.cmake @@ -7,14 +7,21 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-absolute.patch + 0003-dependency-spdlog.diff ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_LGPL_SHARED_LIBS) file(REMOVE "${SOURCE_PATH}/cmake_modules/FindBLAS.cmake") +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + spdlog G2O_USE_LOGGING +) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + ${FEATURE_OPTIONS} -DBUILD_LGPL_SHARED_LIBS=${BUILD_LGPL_SHARED_LIBS} -DG2O_BUILD_EXAMPLES=OFF -DG2O_BUILD_APPS=OFF diff --git a/ports/g2o/vcpkg.json b/ports/g2o/vcpkg.json index ca0000d3fd7b42..c54ff90755dd66 100644 --- a/ports/g2o/vcpkg.json +++ b/ports/g2o/vcpkg.json @@ -1,14 +1,13 @@ { "name": "g2o", "version-date": "2024-12-14", - "port-version": 1, + "port-version": 2, "description": "g2o: A General Framework for Graph Optimization", "homepage": "https://openslam.org/g2o.html", "dependencies": [ "ceres", "eigen3", "lapack", - "spdlog", "suitesparse", { "name": "vcpkg-cmake", @@ -18,5 +17,13 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "features": { + "spdlog": { + "description": "Use spdlog for logging", + "dependencies": [ + "spdlog" + ] + } + } } diff --git a/versions/baseline.json b/versions/baseline.json index 4ec4b5390fc7f0..1ced2065f9a4cc 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2986,7 +2986,7 @@ }, "g2o": { "baseline": "2024-12-14", - "port-version": 1 + "port-version": 2 }, "g3log": { "baseline": "2.4", diff --git a/versions/g-/g2o.json b/versions/g-/g2o.json index ff19634dc7a242..2b0de10b6aba54 100644 --- a/versions/g-/g2o.json +++ b/versions/g-/g2o.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3c1f1836df83234a33a1f96cb292331f45f1650f", + "version-date": "2024-12-14", + "port-version": 2 + }, { "git-tree": "a4cbc27e6ebb4c53963c9cff2b686ea4dc12e4d3", "version-date": "2024-12-14",