diff options
author | Brad King <brad.king@kitware.com> | 2023-06-20 17:08:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-06-20 17:08:46 (GMT) |
commit | f342a655e43d05f553dbbd49d48721ac41469424 (patch) | |
tree | 9b5159e51594fc275946f7bafc656a0f0e7e3b51 | |
parent | 21d409534a6ee884db9740f1e16f7d3d6bb950d8 (diff) | |
parent | fc7dcc6a24ffd33b780104ebd9dbb115d306827e (diff) | |
download | CMake-f342a655e43d05f553dbbd49d48721ac41469424.zip CMake-f342a655e43d05f553dbbd49d48721ac41469424.tar.gz CMake-f342a655e43d05f553dbbd49d48721ac41469424.tar.bz2 |
Merge topic 'FindProtobuf-version-schemes' into release-3.27
fc7dcc6a24 FindProtobuf: Support new version number scheme
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8574
-rw-r--r-- | Modules/FindProtobuf.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index c73a2d8..b046fcc 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -499,7 +499,11 @@ 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") - set(Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}") + 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() if(Protobuf_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " |