From 176de7c7c846f8202db4c087c23249cf68a85322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Fri, 14 Jul 2023 15:49:44 +0200 Subject: [PATCH] Fix regression in FindProtobuf.cmake --- ...Fix-regression-in-FindProtobuf.cmake.patch | 36 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 37 insertions(+) create mode 100644 debian/patches/0002-Fix-regression-in-FindProtobuf.cmake.patch diff --git a/debian/patches/0002-Fix-regression-in-FindProtobuf.cmake.patch b/debian/patches/0002-Fix-regression-in-FindProtobuf.cmake.patch new file mode 100644 index 000000000..52aaf0f28 --- /dev/null +++ b/debian/patches/0002-Fix-regression-in-FindProtobuf.cmake.patch @@ -0,0 +1,36 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +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() diff --git a/debian/patches/series b/debian/patches/series index 812333042..f65b88924 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Prefer-default-Python-version.patch +0002-Fix-regression-in-FindProtobuf.cmake.patch