Skip to content

Commit 96089d5

Browse files
committed
fallback to generator expression for protoc target
1 parent fe51f29 commit 96089d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/SetupProtobuf.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ if(NOT USERVER_FORCE_DOWNLOAD_PROTOBUF)
6060

6161
if(Protobuf_FOUND)
6262
_userver_set_protobuf_version_category()
63-
set(PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
63+
if (TARGET protobuf::protoc)
64+
set(PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
65+
else()
66+
set(PROTOBUF_PROTOC "${Protobuf_PROTOC_EXECUTABLE}")
67+
endif()
6468
return()
6569
endif()
6670
endif()

0 commit comments

Comments
 (0)