From 60c26f8f1ec31c3b10f026ce40779c7b412a7667 Mon Sep 17 00:00:00 2001 From: Georgy Mironov Date: Thu, 4 Oct 2018 13:48:40 +0300 Subject: [PATCH] Fix install with external protobuf --- cmake/OpenCVFindProtobuf.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake index 289fa60641..98e1ce2406 100644 --- a/cmake/OpenCVFindProtobuf.cmake +++ b/cmake/OpenCVFindProtobuf.cmake @@ -44,8 +44,10 @@ else() if(Protobuf_FOUND) if(TARGET protobuf::libprotobuf) - add_library(libprotobuf INTERFACE) - target_link_libraries(libprotobuf INTERFACE protobuf::libprotobuf) + add_library(libprotobuf INTERFACE IMPORTED) + set_target_properties(libprotobuf PROPERTIES + INTERFACE_LINK_LIBRARIES protobuf::libprotobuf + ) else() add_library(libprotobuf UNKNOWN IMPORTED) set_target_properties(libprotobuf PROPERTIES