icinga2/third-party/cmake
Yonas Habteab 18e5b9aa8a 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-04-01 12:18:21 +02:00
..
protobuf CMake: provide newer FindProtobuf.cmake for old CMake version 2026-04-01 12:18:21 +02:00
FindEditline.cmake Implement support for libedit 2015-03-17 15:05:47 +01:00
FindMySQL.cmake cmake: Update MySQL autodetection to support MariaDB 2019-05-07 22:18:50 +02:00
FindPostgreSQL.cmake Add more include/library paths for MySQL and PostgreSQL 2018-01-03 01:11:54 +01:00
FindTermcap.cmake Implement support for libedit 2015-03-17 15:05:47 +01:00
GetGitRevisionDescription.cmake third-party: update GetGitRevisionDescription CMake module 2021-08-06 16:59:23 +02:00
GetGitRevisionDescription.cmake.in third-party: update GetGitRevisionDescription CMake module 2021-08-06 16:59:23 +02:00