Fix regression in FindProtobuf.cmake

ci/unstable
Timo Röhling 2 years ago
parent 739dce790e
commit 176de7c7c8

@ -0,0 +1,36 @@
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Fri, 14 Jul 2023 15:49:28 +0200
Subject: Fix regression in FindProtobuf.cmake
Bug: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8629
---
Modules/FindProtobuf.cmake | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index b046fcc..5cad383 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -499,11 +499,7 @@ if(Protobuf_INCLUDE_DIR)
math(EXPR _PROTOBUF_MAJOR_VERSION "${Protobuf_LIB_VERSION} / 1000000")
math(EXPR _PROTOBUF_MINOR_VERSION "${Protobuf_LIB_VERSION} / 1000 % 1000")
math(EXPR _PROTOBUF_SUBMINOR_VERSION "${Protobuf_LIB_VERSION} % 1000")
- if (_PROTOBUF_MINOR_VERSION GREATER_EQUAL "21")
- set(Protobuf_VERSION "${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
- else()
- set(Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
- endif()
+ set(Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
if(Protobuf_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -524,7 +520,8 @@ if(Protobuf_INCLUDE_DIR)
"${Protobuf_PROTOC_EXECUTABLE} reveals version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}")
endif()
- if(NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${Protobuf_VERSION}")
+ if(NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${Protobuf_VERSION}" AND
+ NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
message(WARNING "Protobuf compiler version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}"
" doesn't match library version ${Protobuf_VERSION}")
endif()

@ -1 +1,2 @@
0001-Prefer-default-Python-version.patch
0002-Fix-regression-in-FindProtobuf.cmake.patch

Loading…
Cancel
Save