From: Joel Rosdahl Date: Thu, 23 Apr 2026 06:45:36 +0000 (+0200) Subject: build: Add "include guards" for bundled CMake find modules X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=ca39469945274b2693941a810c5eb27eeacf670b;p=thirdparty%2Fccache.git build: Add "include guards" for bundled CMake find modules Fixes #1737. --- diff --git a/cmake/FindBlake3.cmake b/cmake/FindBlake3.cmake index f7d2a81a..b9325243 100644 --- a/cmake/FindBlake3.cmake +++ b/cmake/FindBlake3.cmake @@ -1,3 +1,7 @@ +if(Blake3_FOUND) + return() +endif() + mark_as_advanced(BLAKE3_INCLUDE_DIR) mark_as_advanced(BLAKE3_LIBRARY) @@ -28,3 +32,5 @@ else() message(STATUS "Using bundled Blake3 since Blake3>=${Blake3_FIND_VERSION} was not found locally") endif() endif() + +set(Blake3_FOUND 1) diff --git a/cmake/FindCppHttplib.cmake b/cmake/FindCppHttplib.cmake index 3c68335a..1b39cd53 100644 --- a/cmake/FindCppHttplib.cmake +++ b/cmake/FindCppHttplib.cmake @@ -1,3 +1,7 @@ +if(CppHttplib_FOUND) + return() +endif() + mark_as_advanced(CPPHTTPLIB_INCLUDE_DIR) mark_as_advanced(CPPHTTPLIB_LIBRARY) @@ -42,3 +46,5 @@ else() message(STATUS "Using bundled CppHttplib since CppHttplib>=${CppHttplib_FIND_VERSION} was not found locally") endif() endif() + +set(CppHttplib_FOUND 1) diff --git a/cmake/FindDoctest.cmake b/cmake/FindDoctest.cmake index c4d43970..f8bc6a63 100644 --- a/cmake/FindDoctest.cmake +++ b/cmake/FindDoctest.cmake @@ -1,3 +1,7 @@ +if(Doctest_FOUND) + return() +endif() + mark_as_advanced(DOCTEST_INCLUDE_DIR) if(DEPS STREQUAL "DOWNLOAD" OR DEP_DOCTEST STREQUAL "DOWNLOAD") @@ -39,3 +43,4 @@ if(_download_doctest) endif() register_dependency(Doctest "${_doctest_origin}" "${_doctest_version_string}") +set(Doctest_FOUND 1) diff --git a/cmake/FindFmt.cmake b/cmake/FindFmt.cmake index 3fa32f56..b8825f0a 100644 --- a/cmake/FindFmt.cmake +++ b/cmake/FindFmt.cmake @@ -1,3 +1,7 @@ +if(Fmt_FOUND) + return() +endif() + mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY) if(DEPS STREQUAL "DOWNLOAD" OR DEP_FMT STREQUAL "BUNDLED") @@ -37,3 +41,5 @@ else() message(STATUS "Using bundled Fmt since Fmt>=${Fmt_FIND_VERSION} was not found locally") endif() endif() + +set(Fmt_FOUND 1) diff --git a/cmake/FindHiredis.cmake b/cmake/FindHiredis.cmake index 559b98c3..c28e3baf 100644 --- a/cmake/FindHiredis.cmake +++ b/cmake/FindHiredis.cmake @@ -1,3 +1,7 @@ +if(Hiredis_FOUND) + return() +endif() + mark_as_advanced(HIREDIS_INCLUDE_DIR HIREDIS_LIBRARY) if(DEPS STREQUAL "DOWNLOAD" OR DEP_HIREDIS STREQUAL "DOWNLOAD") @@ -76,3 +80,5 @@ if(WIN32) endif() register_dependency(Hiredis "${_hiredis_origin}" "${_hiredis_version_string}") + +set(Hiredis_FOUND 1) diff --git a/cmake/FindTlExpected.cmake b/cmake/FindTlExpected.cmake index 93a6267b..97007edc 100644 --- a/cmake/FindTlExpected.cmake +++ b/cmake/FindTlExpected.cmake @@ -1,3 +1,7 @@ +if(TlExpected_FOUND) + return() +endif() + mark_as_advanced(TLEXPECTED_INCLUDE_DIR) if(DEP_TLEXPECTED STREQUAL "BUNDLED") @@ -19,3 +23,5 @@ else() message(STATUS "Using bundled TlExpected since TlExpected>=${TlExpected_FIND_VERSION} was not found locally") endif() endif() + +set(TlExpected_FOUND 1) diff --git a/cmake/FindXxhash.cmake b/cmake/FindXxhash.cmake index b1a1cdd3..a9e1d101 100644 --- a/cmake/FindXxhash.cmake +++ b/cmake/FindXxhash.cmake @@ -1,3 +1,7 @@ +if(Xxhash_FOUND) + return() +endif() + mark_as_advanced(XXHASH_INCLUDE_DIR XXHASH_LIBRARY) if(DEPS STREQUAL "DOWNLOAD" OR DEP_XXHASH STREQUAL "DOWNLOAD") @@ -66,3 +70,4 @@ if(WIN32) endif() register_dependency(Xxhash "${_xxhash_origin}" "${_xxhash_version_string}") +set(Xxhash_FOUND 1) diff --git a/cmake/FindZstd.cmake b/cmake/FindZstd.cmake index 9a7ffa78..aa642186 100644 --- a/cmake/FindZstd.cmake +++ b/cmake/FindZstd.cmake @@ -1,3 +1,7 @@ +if(Zstd_FOUND) + return() +endif() + mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY) if(DEPS STREQUAL "DOWNLOAD" OR DEP_ZSTD STREQUAL "DOWNLOAD") @@ -75,3 +79,4 @@ if(_download_zstd) endif() register_dependency(Zstd "${_zstd_origin}" "${_zstd_version_string}") +set(Zstd_FOUND 1)