raulcd commented on PR #43417:
URL: https://github.com/apache/arrow/pull/43417#issuecomment-2257897224
ok, vcpkg uses `CONFIG` for find_package and does not use
`FindProtobuf.cmake` but `ProtobufConfig.cmake`protobuf-config.cmake` based on
debug:
```
/opt/vcpkg/installed/amd64-linux-static-release/share/protobuf/ProtobufConfig.cmake
/opt/vcpkg/installed/amd64-linux-static-release/share/protobuf/protobuf-config.cmake
```
This does not populate `PROTOBUF_STATIC_LIB` nor `PROTOC_STATIC_LIB`, the
following snippet for `orc.diff` fixes the issue:
```diff
diff --git a/cmake_modules/ThirdpartyToolchain.cmake
b/cmake_modules/ThirdpartyToolchain.cmake
index aa520ff..7bd75d1 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -416,6 +416,18 @@ endif ()
if (NOT "${PROTOBUF_HOME}" STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan")
find_package (Protobuf REQUIRED)
set(PROTOBUF_VENDORED FALSE)
+ if (Protobuf_FOUND AND NOT PROTOBUF_STATIC_LIB)
+ get_target_property (target_type protobuf::libprotobuf TYPE)
+ if (target_type STREQUAL "STATIC_LIBRARY")
+ set(PROTOBUF_STATIC_LIB protobuf::libprotobuf)
+ endif ()
+ endif()
+ if (Protobuf_FOUND AND NOT PROTOC_STATIC_LIB)
+ get_target_property (target_type protobuf::libprotoc TYPE)
+ if (target_type STREQUAL "STATIC_LIBRARY")
+ set (PROTOC_STATIC_LIB protobuf::libprotoc)
+ endif ()
+ endif()
else ()
set(PROTOBUF_PREFIX "${THIRDPARTY_DIR}/protobuf_ep-install")
set(PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include")
```
--
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]