cmake PROTOBUF_LIBRARIES 静态库
时间: 2023-09-09 15:12:28 浏览: 189
引用中提到了使用cmake时可以通过指定-DCMAKE_PREFIX_PATH选项来指定protobuf库的路径。具体的命令是:
cmake -DCMAKE_PREFIX_PATH=/usr/protobuf ..
引用中提到了手动编译和安装protobuf库的方法。在步骤四中,使用了-DProtobuf_LIBRARIES和-DProtobuf_INCLUDE_DIR来指定protobuf库的路径。具体的命令是:
cmake . -B build -DProtobuf_LIBRARIES=C:\protobuf-21.12\lib -DProtobuf_INCLUDE_DIR=C:\protobuf-21.12\include
综上所述,要在cmake中指定protobuf库的路径,可以使用-DCMAKE_PREFIX_PATH选项或者-DProtobuf_LIBRARIES和-DProtobuf_INCLUDE_DIR选项来指定。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [MNN 编译时,提示Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)](https://blog.csdn.net/mushroom_tom/article/details/121792124)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR)](https://blog.csdn.net/weixin_37684231/article/details/128845367)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文