cmake编译protobuf时find_package()报错?
我的cmake
如下
cmake_minimum_required (VERSION 3.0)
project (cmake_for_protobuf)
include(FindProtobuf)
FIND_PACKAGE(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
#...
报错如下:
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindProtobuf.cmake:543 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:7 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
我的protobuf安装目录为/usr/local/protobuf
我要是改成find_package(protobuf REQUIRED)
, (改成小写的protobuf)
就会报错缺少
protobufConfig.cmake
protobuf-config.cmake
个人解决不了了... 请教以下大家
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论