我正在按照https://github.com/aws/aws-sdk-cpp上的安装说明,在Ubuntu 20.04中安装
aws-cpp-sdk
。按照指示从源代码构建/安装了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安装文件夹,但这并没有解决我的问题。那就是我卡住的地方。感谢任何意见。
message()
调用,这个调用会打印出/usr/local/lib/cmake/lib/cmake
这一行。这是AWS_MODULE_PATH
变量的值,对吗?他们计算这个变量的方式相当奇怪。 似乎这个变量的值应该是/usr/local/lib/cmake
。尝试直接在CMakeLists.txt
中将变量设置为该值(并检查该目录是否包含AwsCFlags.cmake
和其他.cmake
脚本)。 - Tsyvarevcmake .. -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/
尽管有些测试失败了。如果你想写一个答案,请继续,否则我应该删除这篇文章吗? - JanuszCMakeLists.txt
,据我理解,AWS_MODULE_PATH
的计算是个问题。但是我不知道正确的方法。你可以回答你的问题并描述可行的方法。(虽然我们更喜欢“可行”与“正确”相同,但在现实生活中它们有时可能会有所不同:)) - Tsyvarev