【发布时间】:2021-01-21 14:15:11
【问题描述】:
我正在 Ubuntu 20.04 中安装 aws-cpp-sdk,遵循以下安装说明:https://github.com/aws/aws-sdk-cpp
我按照有效的说明从源代码构建/安装了 SDK。安装地点:
- /usr/local/lib
- /usr/local/include/aws
我按照说明构建/安装了aws-c-common(尽管我没有使用DCMAKE_INSTALL_PREFIX)。
我尝试构建aws-checksums,但无法通过 cmake。当我在代码目录中的构建目录中运行cmake .. 时,我得到:
-- The C compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
/usr/local/lib/cmake/lib/cmake
CMake Error at CMakeLists.txt:32 (include):
include could not find load file:
AwsCFlags
CMake Error at CMakeLists.txt:33 (include):
include could not find load file:
AwsCheckHeaders
CMake Error at CMakeLists.txt:34 (include):
include could not find load file:
AwsSharedLibSetup
CMake Error at CMakeLists.txt:35 (include):
include could not find load file:
AwsSanitizers
CMake Error at CMakeLists.txt:37 (include):
include could not find load file:
AwsFindPackage
CMake Error at CMakeLists.txt:38 (include):
include could not find load file:
AwsFeatureTests
CMake Error at CMakeLists.txt:116 (aws_set_common_properties):
Unknown CMake command "aws_set_common_properties".
-- Configuring incomplete, errors occurred!
See also ...
我尝试将前缀指向 sdk 安装文件夹,但这并没有解决我的问题。那就是我卡住的地方。任何输入表示赞赏。谢谢。
【问题讨论】:
-
您似乎已经向CMakeLists.txt 添加了一些
message()调用,并且此调用打印了/usr/local/lib/cmake/lib/cmake行。这是AWS_MODULE_PATH变量的值,不是吗?他们对变量的计算很奇怪。看起来变量的值应该是/usr/local/lib/cmake。尝试将CMakeLists.txt中的变量直接设置为该值(并检查该目录是否包含AwsCFlags.cmake和其他.cmake脚本)。 -
@Tsyvarev 感谢您的提示。你是对的,我不得不改变前缀。
cmake .. -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/虽然有些测试确实失败了。我想写一个答案去吧,否则我应该删除这个帖子吗? -
我不想回答。我只能看到他们的
CMakeLists.txt,并且据我了解AWS_MODULE_PATH的计算是一个问题。但我不知道正确的方式。您可以回答您的问题并描述工作方式。 (虽然我们更喜欢“工作”与“正确”相同,但在现实生活中它们有时可能会有所不同:))
标签: c++ amazon-web-services amazon-s3 cmake aws-sdk