From 0649d4910d7f47467ab1519c66e140fe615a8e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Fri, 19 Dec 2025 20:16:25 +0100 Subject: [PATCH] Add llhttp-config-version.cmake This allows CMake to use find_package with a compatible version of llhttp. find_package(llhttp 9.0.0 REQUIRED) -- The following REQUIRED packages have been found: * llhttp (required version >= 9.0.0) --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20995883..35c52b08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,17 @@ function(config_library target) NAMESPACE llhttp:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp ) + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/llhttp-config-version.cmake + COMPATIBILITY AnyNewerVersion + ) + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/llhttp-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp + ) + endfunction(config_library target) if(LLHTTP_BUILD_SHARED_LIBS)