2021-09-04 13:25:12 +08:00
|
|
|
--- a/cmake/OpenCVFindProtobuf.cmake
|
|
|
|
+++ b/cmake/OpenCVFindProtobuf.cmake
|
2024-11-06 03:17:22 +08:00
|
|
|
@@ -34,7 +34,7 @@ else()
|
|
|
|
set(protobuf_MODULE_COMPATIBLE ON)
|
|
|
|
|
2021-09-04 13:25:12 +08:00
|
|
|
unset(Protobuf_VERSION CACHE)
|
2024-11-06 03:17:22 +08:00
|
|
|
- find_package(Protobuf QUIET CONFIG)
|
2021-09-04 13:25:12 +08:00
|
|
|
+ find_package(Protobuf CONFIG REQUIRED)
|
2024-11-06 03:17:22 +08:00
|
|
|
if(NOT Protobuf_FOUND)
|
|
|
|
find_package(Protobuf QUIET)
|
|
|
|
endif()
|
|
|
|
@@ -97,6 +97,7 @@ if(HAVE_PROTOBUF)
|
|
|
|
unset( __location)
|
2021-09-04 13:25:12 +08:00
|
|
|
if(TARGET "${Protobuf_LIBRARIES}")
|
|
|
|
get_target_property(__location "${Protobuf_LIBRARIES}" IMPORTED_LOCATION_RELEASE)
|
|
|
|
+ get_target_property(__location_debug "${Protobuf_LIBRARIES}" IMPORTED_LOCATION_DEBUG)
|
|
|
|
if(NOT __location)
|
|
|
|
get_target_property(__location "${Protobuf_LIBRARIES}" IMPORTED_LOCATION)
|
|
|
|
endif()
|
2024-11-06 03:17:22 +08:00
|
|
|
@@ -112,5 +113,5 @@ if(HAVE_PROTOBUF)
|
2021-09-04 13:25:12 +08:00
|
|
|
endif()
|
|
|
|
list(APPEND CUSTOM_STATUS_protobuf " Protobuf:"
|
|
|
|
BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})"
|
|
|
|
- ELSE "${__location} (${Protobuf_VERSION})")
|
|
|
|
+ ELSE "optimized ${__location} debug ${__location_debug} ; version (${Protobuf_VERSION})")
|
|
|
|
endif()
|