fix(cmake): require cpp-httplib >= 0.14 in pkg-config check#230
Merged
Conversation
Add minimum version constraint to pkg_check_modules() so that old system packages (e.g. 0.10.x on Ubuntu 22.04 Jammy) are rejected and the cmake/source-build fallback path is used instead. Without this, building on Humble with libcpp-httplib-dev installed fails due to missing StatusCode enum and std::string overloads that were added in cpp-httplib 0.14. Also improves error reporting: - FATAL_ERROR with clear diagnosis and fix instructions when neither pkg-config nor cmake config finds a suitable cpp-httplib - Updated installation.rst prerequisites and troubleshooting sections Closes #225
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a build failure on ROS 2 Humble (Ubuntu 22.04) when the system libcpp-httplib-dev package is installed. The system package provides cpp-httplib 0.10.x, which lacks the httplib::StatusCode enum and std::string API overloads that ros2_medkit requires (available in cpp-httplib >= 0.14). The fix adds a minimum version constraint to the pkg-config check so that old versions are rejected and the CMake/source-build fallback path is used instead. It also improves error reporting with clear installation instructions.
Changes:
- Add
>=0.14version constraint topkg_check_modules()in the cpp-httplib finder macro - Convert
find_package(httplib REQUIRED)toQUIETmode with explicit error handling and helpfulFATAL_ERRORmessage containing installation instructions - Update installation documentation to explain the version requirement and provide clear removal/installation steps for Humble users
- Add troubleshooting section for the specific
httplib::StatusCode has not been declarederror
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmake/ROS2MedkitCompat.cmake | Adds version constraint to pkg-config check, converts to QUIET mode with explicit error handling, improves status messages |
| docs/installation.rst | Updates prerequisites note and adds troubleshooting section with clear installation instructions for cpp-httplib >= 0.14 |
mfaferek93
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Add minimum version constraint (
>=0.14) topkg_check_modules()inmedkit_find_cpp_httplib()so that old system packages (e.g. 0.10.x on Ubuntu 22.04 Jammy) are rejected and the cmake/source-build fallback path is used instead.Also improves error reporting with a clear
FATAL_ERRORmessage when no suitable cpp-httplib is found, and updates installation docs with prerequisites and troubleshooting guidance.Issue
Type
Testing
>=0.14libcpp-httplib-devinstalled: pkg-config now rejects 0.10.x, falls through to cmake config path (source-built cpp-httplib)FATAL_ERRORwith installation instructions instead of a crypticfind_package(httplib REQUIRED)failureChecklist