通过u4 -conan安装时缺少protobuf配置



我试图让gRPC在虚幻引擎4中运行,使用conan-ue4cli工具。我使用这里链接的提供的grpc-ue4配方:https://github.com/adamrehn/ue4-conan-recipes/tree/master/grpc-ue4

运行ue4 conan build "grpc-ue4"时抛出错误无法找到由"Protobuf">">

提供的包配置文件输出:

...
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found c-ares: C:/Users/Redux Gamer/.conan/data/cares-ue4/1.16.1/adamrehn/4.27/package/7333dc905312a2df09e78e1a60d59e628a5f0321/lib/cmake/c-ares/c-ares-config.cmake (found suitable version "1.16.1", minimum required is "1.13.0")
CMake Error at cmake/protobuf.cmake:58 (find_package):
Could not find a package configuration file provided by "Protobuf" with any
of the following names:
ProtobufConfig.cmake
protobuf-config.cmake
Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
"Protobuf_DIR" to a directory containing one of the above files.  If
"Protobuf" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:224 (include)

-- Configuring incomplete, errors occurred!
See also "C:/.conan/9d531a/1/CMakeFiles/CMakeOutput.log".
See also "C:/.conan/9d531a/1/CMakeFiles/CMakeError.log".
grpc-ue4/1.30.2@adamrehn/4.27:
grpc-ue4/1.30.2@adamrehn/4.27: ERROR: Package 'bf9f4e336e64d98ce96ba6aaac093ac1ff3705d4' build failed
grpc-ue4/1.30.2@adamrehn/4.27: WARN: Build folder C:.conan9d531a1
ERROR: grpc-ue4/1.30.2@adamrehn/4.27: Error in build() method, line 98
cmake.configure(source_folder="grpc", args=self.cmake_flags())
ConanException: Error 1 while executing cd C:.conan9d531a1 && ...

我正在运行Windows 10, UE4.27, python 3.7.8, cmake 3.21.3。我试着寻找丢失的protobuf-config。cmake但也不能发现柯南或项目文件夹。

如有任何建议或指示,将不胜感激。

负责的conan文件在这里:https://github.com/adamrehn/ue4-conan-recipes/tree/master/grpc-ue4/1.30.2

这打破了提交865 c38e99f694e63fd109ae06423472ebb7885a3(见:https://github.com/adamrehn/ue4-conan-recipes/pull/8)

恢复这对我改变解决它。

手动修复:转到C:UsersUSERNAME.conandatagrpc-ue41.30.2adamrehn4.27exportconanfile.py并在第51行更改:

"-DProtobuf_DIR=" + os.path.join(protobuf.rootpath, "lib/cmake/protobuf"),

"-DProtobuf_DIR=" + os.path.join(protobuf.rootpath, "cmake"),

然后您需要运行带有--no-cache参数的命令(否则该配方将再次被原始配方替换)ue4 conan build grpc-ue4 --no-cache

最新更新