From: Sam James Date: Sat, 8 Jun 2024 14:11:48 +0000 (+0100) Subject: build: Find CppHttplib named libhttplib.so as well (#1465) X-Git-Tag: v4.10.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bc9a4562ff8cacf62fc02f2f4732510cc5fbe1f;p=thirdparty%2Fccache.git build: Find CppHttplib named libhttplib.so as well (#1465) On Gentoo, the library name is 'httplib', not 'cpp-httplib'. Search for that first (as it appears to be "more vanilla"), then fall back to 'cpp-httplib'. (cherry picked from commit a641e5ea3087752af71e60690dcf3ed3c1dbc56a) --- diff --git a/cmake/FindCppHttplib.cmake b/cmake/FindCppHttplib.cmake index d74ad323..49d80d6e 100644 --- a/cmake/FindCppHttplib.cmake +++ b/cmake/FindCppHttplib.cmake @@ -12,7 +12,11 @@ else() if(NOT "${CMAKE_MATCH_0}" STREQUAL "" AND "${_cpphttplib_version_string}" VERSION_GREATER_EQUAL "${CppHttplib_FIND_VERSION}") # Some dists like Fedora package cpp-httplib as a single header while some # dists like Debian package it as a traditional library. - find_library(CPPHTTPLIB_LIBRARY cpp-httplib) + find_library(CPPHTTPLIB_LIBRARY httplib) + if(NOT CPPHTTPLIB_LIBRARY) + find_library(CPPHTTPLIB_LIBRARY cpp-httplib) + endif() + if(CPPHTTPLIB_LIBRARY) message(STATUS "Using system CppHttplib (${CPPHTTPLIB_LIBRARY})") add_library(dep_cpphttplib UNKNOWN IMPORTED)