From df6b20569fd7a07fbb419f09bc4d1257f00dd677 Mon Sep 17 00:00:00 2001 From: wangguibao Date: Mon, 1 Jul 2019 14:32:19 +0800 Subject: [PATCH] Fix protobuf.cmake for CMake 3.9 and above --- cmake/external/protobuf.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index e05b7694..568297b0 100644 --- a/cmake/external/protobuf.cmake +++ b/cmake/external/protobuf.cmake @@ -122,6 +122,9 @@ macro(PROMPT_PROTOBUF_LIB) # make `protobuf_generate_cpp` happy. SET(Protobuf_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE}) + # For CMake 3.9 and above + add_executable(protobuf::protoc ALIAS protoc) + FOREACH(dep ${protobuf_DEPS}) ADD_DEPENDENCIES(protobuf ${dep}) ADD_DEPENDENCIES(protobuf_lite ${dep}) -- GitLab