Skip to content

Commit e8cc656

Browse files
committed
add a fix for protoc path
1 parent 60fcae0 commit e8cc656

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cpp/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,9 @@ set(PROTO_HDRS "${CMAKE_CURRENT_BINARY_DIR}/cuopt_remote.pb.h")
358358

359359
# Find protoc compiler (provided by config package or target)
360360
if(TARGET protobuf::protoc)
361-
get_target_property(_PROTOBUF_PROTOC protobuf::protoc IMPORTED_LOCATION_RELEASE)
362-
if(NOT _PROTOBUF_PROTOC)
363-
get_target_property(_PROTOBUF_PROTOC protobuf::protoc IMPORTED_LOCATION)
364-
endif()
361+
set(_PROTOBUF_PROTOC "$<TARGET_FILE:protobuf::protoc>")
362+
elseif(TARGET Protobuf::protoc)
363+
set(_PROTOBUF_PROTOC "$<TARGET_FILE:Protobuf::protoc>")
365364
else()
366365
set(_PROTOBUF_PROTOC ${Protobuf_PROTOC_EXECUTABLE})
367366
endif()

0 commit comments

Comments
 (0)