Skip to content

Commit

Permalink
Help CMake resolve protobuf::protoc when not building it.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepurvis authored and Mizux committed Jul 15, 2020
1 parent cda6cc5 commit 92fd9c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/FindProtobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ find_package(PkgConfig REQUIRED)

pkg_check_modules(PROTOBUF REQUIRED protobuf IMPORTED_TARGET GLOBAL)
add_library(protobuf::libprotobuf ALIAS PkgConfig::PROTOBUF)

find_program(PROTOC_EXEC protoc REQUIRED)
add_executable(protobuf::protoc IMPORTED GLOBAL)
set_target_properties(protobuf::protoc PROPERTIES
IMPORTED_LOCATION ${PROTOC_EXEC}
)

0 comments on commit 92fd9c5

Please sign in to comment.