Ubunut 18.04
master
g++ 7.4.0
None
(CMAKE_PREFIX_PATH Includes path to build directory)
When compiling a sample application, I get the following stack trace:
CMake Error at /usr/local/lib/aws-c-common/cmake/aws-c-common-config.cmake:7 (include):
include could not find load file:
/usr/local/lib/aws-c-common/cmake/static/aws-c-common-targets.cmake
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib/aws-c-event-stream/cmake/aws-c-event-stream-config.cmake:2 (find_dependency)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib/cmake/aws-cpp-sdk-core/aws-cpp-sdk-core-config.cmake:2 (find_dependency)
/usr/local/lib/cmake/AWSSDK/AWSSDKConfig.cmake:292 (find_package)
CMakeLists.txt:10 (find_package)
CMake Error at /usr/local/lib/aws-checksums/cmake/aws-c-event-stream-config.cmake:4 (include):
include could not find load file:
/usr/local/lib/aws-checksums/cmake/static/aws-checksums-targets.cmake
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib/aws-c-event-stream/cmake/aws-c-event-stream-config.cmake:3 (find_dependency)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib/cmake/aws-cpp-sdk-core/aws-cpp-sdk-core-config.cmake:2 (find_dependency)
/usr/local/lib/cmake/AWSSDK/AWSSDKConfig.cmake:292 (find_package)
CMakeLists.txt:10 (find_package)
CMake Error at /usr/local/lib/aws-c-event-stream/cmake/aws-c-event-stream-config.cmake:8 (include):
include could not find load file:
/usr/local/lib/aws-c-event-stream/cmake/static/aws-c-event-stream-targets.cmake
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib/cmake/aws-cpp-sdk-core/aws-cpp-sdk-core-config.cmake:2 (find_dependency)
/usr/local/lib/cmake/AWSSDK/AWSSDKConfig.cmake:292 (find_package)
CMakeLists.txt:10 (find_package)
I "fixed" this by editing each of the cmake files (aws-c-event-stream-config.cmake, aws-c-event-stream-config.cmake, and aws-c-common-config.cmake) and removing the if statements so that only the shared path is used.
BUILD_SHARED_LIBS is by default undefined. You can simply specify this at the CMake command line
-DBUILD_SHARED_LIBS=ON
See report: https://github.com/awslabs/aws-c-common/pull/506
Interesting, per the AWS docs, BUILD_SHARED_LIBS defaults to ON.
If this is the case, then there should be a default set in CMake IMO. Thoughts?
It defaults to on in SDK's cmake scripts, but when building your sample application, you provide your own cmake scripts.
even with -DBUILD_SHARED_LIBS=ON, it still got the same error. Oh, never mind, I see the problem there, you need to specify -DBUILD_SHARED_LIBS=ON when doing "cmake . -DBUILD_SHARED_LIBS=ON" on your own app folder.
Same issue here, as jywang01 said, need to do cmake . -DBUILD_SHARED_LIBS=ON" on your own app folder.
Most helpful comment
Same issue here, as jywang01 said, need to do cmake . -DBUILD_SHARED_LIBS=ON" on your own app folder.