Skip to content

Commit

Permalink
[C++][CMake] correctly use Protobuf_PROTOC_EXECUTABLE
Browse files Browse the repository at this point in the history
Authored-by: H. Vetinari <h.vetinari@gmx.com>
Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: H. Vetinari <h.vetinari@gmx.com>
  • Loading branch information
h-vetinari and raulcd committed May 8, 2024
1 parent 5385926 commit ec001f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/cmake_modules/FindProtobufAlt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ endif()
find_package(protobuf CONFIG ${find_package_args})
set(ProtobufAlt_FOUND ${protobuf_FOUND})
if(ProtobufAlt_FOUND)
if(Protobuf_PROTOC_EXECUTABLE)
# work around https://github.com/protocolbuffers/protobuf/issues/14576
set_target_properties(protobuf::protoc PROPERTIES IMPORTED_LOCATION_RELEASE
"${Protobuf_PROTOC_EXECUTABLE}")
endif()
set(ProtobufAlt_VERSION ${protobuf_VERSION})
set(ProtobufAlt_VERSION_MAJOR ${protobuf_VERSION_MAJOR})
set(ProtobufAlt_VERSION_MINOR ${protobuf_VERSION_MINOR})
Expand Down

0 comments on commit ec001f1

Please sign in to comment.