stiga-huang commented on code in PR #1529:
URL: https://github.com/apache/orc/pull/1529#discussion_r1218002691


##########
cmake_modules/FindProtobuf.cmake:
##########
@@ -26,6 +26,24 @@
 # PROTOBUF_EXECUTABLE: location of protoc
 
 
+find_package (Protobuf CONFIG)
+if (Protobuf_FOUND)
+    set (PROTOBUF_LIBRARY protobuf::libprotobuf)
+    set (PROTOBUF_STATIC_LIB PROTOBUF_STATIC_LIB-NOTFOUND)
+    set (PROTOC_LIBRARY protobuf::libprotoc)
+    set (PROTOC_STATIC_LIB PROTOC_STATIC_LIB-NOTFOUND)
+    get_target_property (target_type protobuf::libprotobuf TYPE)
+    if (target_type STREQUAL "STATIC_LIBRARY")
+        set(PROTOBUF_STATIC_LIB protobuf::libprotobuf)
+    endif ()
+    get_target_property (target_type protobuf::libprotoc TYPE)
+    if (target_type STREQUAL "STATIC_LIBRARY")
+        set (PROTOC_STATIC_LIB protobuf::libprotoc)
+    endif ()
+    get_target_property (PROTOBUF_INCLUDE_DIR protobuf::libprotoc 
INTERFACE_INCLUDE_DIRECTORIES)

Review Comment:
    `PROTOBUF_EXECUTABLE` is missing here. Is it set in protobuf's own CMake 
configs?



##########
cmake_modules/FindProtobuf.cmake:
##########
@@ -26,6 +26,24 @@
 # PROTOBUF_EXECUTABLE: location of protoc
 
 
+find_package (Protobuf CONFIG)
+if (Protobuf_FOUND)
+    set (PROTOBUF_LIBRARY protobuf::libprotobuf)
+    set (PROTOBUF_STATIC_LIB PROTOBUF_STATIC_LIB-NOTFOUND)
+    set (PROTOC_LIBRARY protobuf::libprotoc)
+    set (PROTOC_STATIC_LIB PROTOC_STATIC_LIB-NOTFOUND)
+    get_target_property (target_type protobuf::libprotobuf TYPE)
+    if (target_type STREQUAL "STATIC_LIBRARY")
+        set(PROTOBUF_STATIC_LIB protobuf::libprotobuf)
+    endif ()
+    get_target_property (target_type protobuf::libprotoc TYPE)
+    if (target_type STREQUAL "STATIC_LIBRARY")
+        set (PROTOC_STATIC_LIB protobuf::libprotoc)
+    endif ()
+    get_target_property (PROTOBUF_INCLUDE_DIR protobuf::libprotoc 
INTERFACE_INCLUDE_DIRECTORIES)
+    return ()

Review Comment:
   Before `return`, it'd be nice to print the variables as we did at line 93 - 
102. Or will the protobuf's config print some info?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to