icinga2/third-party
Yonas Habteab 193f039bed CMake: provide newer FindProtobuf.cmake for old CMake version
This module is copied from CMake's official module repository[^1] and
contains only minor changes as outlined below.

```diff
--- a/third-party/cmake/protobuf/FindProtobuf.cmake
+++ b/third-party/cmake/protobuf/FindProtobuf.cmake
@@ -218,9 +218,6 @@ Example:
         GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc)
 #]=======================================================================]

-cmake_policy(PUSH)
-cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
-
 function(protobuf_generate)
        set(_options APPEND_PATH DESCRIPTORS)
        set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS DEPENDENCIES)
@@ -503,7 +500,7 @@ if( Protobuf_USE_STATIC_LIBS )
        endif()
 endif()

-include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+include(SelectLibraryConfigurations)

 # Internal function: search for normal library as well as a debug one
 #    if the debug one is specified also include debug/optimized keywords
@@ -768,7 +765,7 @@ if(Protobuf_INCLUDE_DIR)
        endif()
 endif()

-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf
        REQUIRED_VARS Protobuf_LIBRARIES Protobuf_INCLUDE_DIR
        VERSION_VAR Protobuf_VERSION
@@ -805,5 +802,3 @@ foreach(Camel
        string(TOUPPER ${Camel} UPPER)
        set(${UPPER} ${${Camel}})
 endforeach()
-
-cmake_policy(POP)
```

[^1]: https://github.com/Kitware/CMake/blob/v3.31.0/Modules/FindProtobuf.cmake
2026-02-06 15:01:58 +01:00
..
cmake CMake: provide newer FindProtobuf.cmake for old CMake version 2026-02-06 15:01:58 +01:00
execvpe Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
mmatch Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
nlohmann_json Update third-party/nlohmann_json to v3.9.1 2023-02-14 16:19:44 +01:00
opentelemetry-proto Vendor opentelemetry-proto with the necessary files 2026-02-06 15:01:58 +01:00
socketpair Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
utf8cpp Remove reference to missing ftest submodule 2025-09-24 15:43:09 +02:00
CMakeLists.txt Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00