Consider the capital Protobuf_VERSION variable in WrapProtoc module

Ensure that we consider the deprecated Protobuf module version
variable when detecting protoc. Sensitive for the debian like Linux
destributions.

Pick-to: 6.9
Change-Id: I48d32c02af0d2c91e9fd2fed2a913464d585031c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2025-01-06 15:41:05 +01:00
parent 2d2a5bc1a7
commit c52c4584e0
1 changed files with 7 additions and 1 deletions

View File

@ -58,10 +58,16 @@ endif()
if(__WrapProtoc_protoc_imported_location) if(__WrapProtoc_protoc_imported_location)
add_executable(WrapProtoc::WrapProtoc IMPORTED) add_executable(WrapProtoc::WrapProtoc IMPORTED)
if(protobuf_VERSION)
set(__WrapProtoc_version_var protobuf_VERSION)
else()
set(__WrapProtoc_version_var Protobuf_VERSION)
endif()
set_target_properties(WrapProtoc::WrapProtoc PROPERTIES set_target_properties(WrapProtoc::WrapProtoc PROPERTIES
IMPORTED_LOCATION "${__WrapProtoc_protoc_imported_location}" IMPORTED_LOCATION "${__WrapProtoc_protoc_imported_location}"
_qt_internal_protobuf_version "${protobuf_VERSION}" _qt_internal_protobuf_version "${${__WrapProtoc_version_var}}"
) )
unset(__WrapProtoc_version_var)
set(WrapProtoc_FOUND TRUE) set(WrapProtoc_FOUND TRUE)
endif() endif()