You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issues Building Project With Cmake and aws-sdk-cpp_DIR #406
My project is a little bit more complex, with multiple project files, but it essentially boils down to these parts:
...
find_package(aws-sdk-cpp)
# Use the created library to link to the source.
add_executable(furnace $<TARGET_OBJECTS:furnace_object> furnace.cpp)
# I tried the blog post aws-cpp-sdk-core ( but maybe that's a typo? )
target_link_libraries(furnace aws-sdk-cpp-core)
...
And then calling this:
cd build
cmake –Daws-sdk-cpp_DIR="/Users/-...-/aws/aws-sdk-cpp-1.0.51/build/" ..
Also, I've built the project on osx. I used it previously, if I hardcoded all the path everywhere, which is less than ideal. So I know the library works fine.
What I'm getting when I'm running this is:
CMake Warning at furnace/CMakeLists.txt:8 (find_package):
By not providing "Findaws-sdk-cpp.cmake"in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"aws-sdk-cpp", but CMake did not find one.
Could not find a package configuration file provided by "aws-sdk-cpp" with
any of the following names:
aws-sdk-cppConfig.cmake
aws-sdk-cpp-config.cmake
Add the installation prefix of "aws-sdk-cpp" to CMAKE_PREFIX_PATH or set"aws-sdk-cpp_DIR" to a directory containing one of the above files. If
"aws-sdk-cpp" provides a separate development package or SDK, be sure it
has been installed.
Apparently, the blog post is NOT a typo. Which is totally insane actually.
Also, apparently, cmake -Daws-sdk-cpp_DIR DID NOT WORK.
However, getting it as an environment variable and setting it in CMAKE worked.
# Find the installed AWS core package
# Don't need all of them
set(aws-sdk-cpp_DIR $ENV{AWS_SDK_CPP_DIR})
find_package(aws-sdk-cpp)
# Use the created library to link to the source.
add_executable(furnace $<TARGET_OBJECTS:furnace_object> furnace.cpp)
target_link_libraries(furnace aws-cpp-sdk-core)
Notice that the exported target is aws-cpp-sdk-core instead of aws-sdk-cpp-core as you would expect.
Using a standard cmake command line option like CMAKE_PREFIX_PATH also works. I prefer that since it's easier to remember and more generic, especially across projects.
As far cpp-sdk vs. sdk-cpp goes, that was an accidental decision made very, very early in the project that now taunts us from an unchangeable position (due to backwards compatibility).
Can someone provide context on what their CMake Text file looks like. I've tried following the thread and the posted solution... but still no luck. Thx
Thanks @Skarlso much appreciated! Did you use the cmake –Daws-sdk-cpp_DIR="/Users/-...-/aws/aws-sdk-cpp-1.0.51/build/" .. convention when calling cmake?
I've reopened #1334 which has a different error related to dependencies, rather than adding more to this issue here. I shouldn't need to globally make install the SDK either, but that doesn't help anyway. I'll update everything when I can make it work.
Activity
Skarlso commentedon Jan 10, 2017
So I solved this.
Apparently, the blog post is NOT a typo. Which is totally insane actually.
Also, apparently, cmake -Daws-sdk-cpp_DIR DID NOT WORK.
However, getting it as an environment variable and setting it in CMAKE worked.
Notice that the exported target is aws-cpp-sdk-core instead of aws-sdk-cpp-core as you would expect.
Is this intentional?
Cheers,
Gergely.
bretambrose commentedon Jan 10, 2017
Using a standard cmake command line option like CMAKE_PREFIX_PATH also works. I prefer that since it's easier to remember and more generic, especially across projects.
As far cpp-sdk vs. sdk-cpp goes, that was an accidental decision made very, very early in the project that now taunts us from an unchangeable position (due to backwards compatibility).
Skarlso commentedon Jan 10, 2017
Yes, but what if I want to set CMAKE_PREFIX_PATH to something else? :) I would rather use something specific. :)
Thanks for the heads up!
This can be closed.
RobertHerreraEECS commentedon Oct 26, 2017
Can someone provide context on what their CMake Text file looks like. I've tried following the thread and the posted solution... but still no luck. Thx
Skarlso commentedon Oct 26, 2017
@RobertHerreraEECS Hey Robert. You can take a peak at my project here: https://github.com/Skarlso/furnace/blob/master/CMakeLists.txt.
I haven't updated it though in a while because frankly, the CPP AWS sdk is terrible in this way that I have to download some gigs of stuff to get parts working. I setup a docker container which had prebuilt libraries so travis could test with the container. That's here: https://hub.docker.com/r/skarlso/gcc/ Have fun.
RobertHerreraEECS commentedon Oct 26, 2017
Thanks @Skarlso much appreciated! Did you use the cmake –Daws-sdk-cpp_DIR="/Users/-...-/aws/aws-sdk-cpp-1.0.51/build/" .. convention when calling cmake?
Skarlso commentedon Oct 26, 2017
No, I think that didn't work in the end. Look at this script how it builds the SDK:
https://github.com/Skarlso/furnace/blob/master/scripts/prepare-aws-sdk.sh
jhodges commentedon Dec 21, 2017
For what it's worth, I got the
–Daws-sdk-cpp_DIR=to work correctly if the directory passed is the fullpath, so /Users/... on macOS.dblock commentedon Mar 3, 2020
I can't get it to work with the instructions in that blog post (
cmake -Daws-sdk-cpp_DIR=full path). Is the blog post incorrect? I will get it fixed.KaibaLopez commentedon Mar 3, 2020
Hi @dblock,
I think the blog post is a bit outdated... could you try and change the cmake to something like:
this assumes that your ran make install on the sdk before hand though.
dblock commentedon Mar 3, 2020
I've reopened #1334 which has a different error related to dependencies, rather than adding more to this issue here. I shouldn't need to globally
make installthe SDK either, but that doesn't help anyway. I'll update everything when I can make it work.