Ildar Sagdejev
Ildar Sagdejev
To be precise, `project( VERSION )` sets `PROJECT_VERSION`. Meanwhile, `find_package(AWSSDK)` sets an unrelated `PACKAGE_VERSION`, which it sets globally. It does make sense to rename it to `AWSSDK_VERSION`, but it does...
Actually, `AWSSDK_VERSION` is also being set, as this will show: ```cmake cmake_minimum_required(VERSION 3.5) project(my_project) find_package(AWSSDK) message(STATUS "AWSSDK_VERSION: ${AWSSDK_VERSION}") ```
https://github.com/aws/aws-sdk-cpp/blob/e4b4b310d8631bc7e9a797b6ac03a73c6f210bf6/cmake/AWSSDKConfig.cmake#L27 I can't seem to figure out where this `.cmake` file actually comes from.
Just add `-DCMAKE_PREFIX_PATH=/where/awssdk/was/installed` when calling cmake.
It is a [built-in](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html) cmake variable intended specifically for this.
Just an observation, the standard `/usr/local` system directory is [meant](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s09.html) to directly contain standard subdirectories such as `bin`, `lib`, `include`, etc., and so it makes more sense to install directly...
I got to exactly the same point by doing `apk add libexecinfo-dev`. ``` [ 20%] Building CXX object CMakeFiles/aws-lambda-runtime.dir/src/logging.cpp.o [ 40%] Building CXX object CMakeFiles/aws-lambda-runtime.dir/src/runtime.cpp.o [ 60%] Building CXX object...
The issue is that `dlfcn.h` isn't being included in `src/backward.h` when building on Alpine. The compiler gets to this point without having included it, but it is required: https://github.com/awslabs/aws-lambda-cpp/blob/5959e2fac63ece49720597979856d3f68ab943a7/src/backward.h#L243-L246
Should be fixed now. Also, add `"execinfo"` to your `target_link_libraries()` in `CMakeLists.txt` in your project so that it links against [libexecinfo](https://www.freshports.org/devel/libexecinfo).
This problem has been noted at the AWS C Common project: https://github.com/awslabs/aws-c-common/issues/322 That project ended up making `execinfo.h` entirely optional.