From 43570f24532cbde6ecf8211dcdd062cce1810f2f Mon Sep 17 00:00:00 2001 From: Richard Cole Date: Mon, 28 Oct 2024 13:20:38 -0700 Subject: [PATCH] Only print pre-release version if it makes sense to do so (#18958) The pre-release version was printed even if it was blank. Move the message inside a pre-existing if condition so it'll only get printed if it's set. Closes #18958 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18958 from imrichardcole:task/remove-blank-printing f0dd1d938b313c10651bb54635aa327f486bcdcf PiperOrigin-RevId: 690727280 --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19bb3db8f04f..c6a744c41861 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,18 +106,17 @@ string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\3" string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\5" protobuf_VERSION_PRERELEASE "${protobuf_VERSION_STRING}") -message(STATUS "${protobuf_VERSION_PRERELEASE}") - # Package version set(protobuf_VERSION "${protobuf_VERSION_MINOR}.${protobuf_VERSION_PATCH}") if(protobuf_VERSION_PRERELEASE) + message(STATUS "${protobuf_VERSION_PRERELEASE}") set(protobuf_VERSION "${protobuf_VERSION}.${protobuf_VERSION_PRERELEASE}") else() set(protobuf_VERSION "${protobuf_VERSION}.0") endif() -message(STATUS "${protobuf_VERSION}") +message(STATUS "protobuf version: ${protobuf_VERSION}") if(protobuf_VERBOSE) message(STATUS "Configuration script parsing status [")