-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use with CPM? #3309
Comments
try replacing:
with when i do that it works as expected, full example Project structure
CMakeLists.txt cmake_minimum_required(VERSION 3.30)
project(cpm_example)
set(CMAKE_CXX_STANDARD 20)
include(cmake/CPM.cmake)
CPMAddPackage(
NAME aws-sdk-cpp
GITHUB_REPOSITORY aws/aws-sdk-cpp
GIT_SUBMODULES_RECURSE TRUE
GIT_TAG "1.11.505"
OPTIONS
"BUILD_ONLY s3"
)
add_executable(cpm_example main.cpp)
target_link_libraries(cpm_example
PRIVATE
aws-cpp-sdk-core
aws-cpp-sdk-s3) main.cpp #include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
using namespace Aws;
using namespace Aws::S3;
auto main() -> int {
SDKOptions options{};
InitAPI(options);
{
S3Client client{};
const auto buckets_outcome = client.ListBuckets();
assert(buckets_outcome.IsSuccess());
std::cout << "Found buckets:\n";
for (const auto& bucket : buckets_outcome.GetResult().GetBuckets())
{
std::cout << bucket.GetName() << "\n";
}
}
ShutdownAPI(options);
return 0;
} |
Nice, it works. But i think that has some problem, because only a single module can be selected. If we use:
It shows:
If im using:
Only the first is considered:
How we can add multiple modules? In docs said that we can use:
But if i use it, the cmake only consider the first:
Thanks. |
As we get into more CPM related questions, gotta call out this is more of a CPM question than a SDK question, the amount i can help with relation to their build system is gunna be limited and they can answer these questions better than I can. That said, from browsing their issues i found cpm-cmake/CPM.cmake#291 which lead to cpm-cmake/CPM.cmake#302 which lead me to the syntax CPM uses to support list options with is a quadruple escaped semi colon, so the following should work cmake_minimum_required(VERSION 3.30)
project(cpm_example)
set(CMAKE_CXX_STANDARD 20)
include(cmake/CPM.cmake)
CPMAddPackage(
NAME aws-sdk-cpp
GITHUB_REPOSITORY aws/aws-sdk-cpp
GIT_SUBMODULES_RECURSE TRUE
GIT_TAG "1.11.505"
OPTIONS "BUILD_ONLY s3\\\\;dynamodb")
add_executable(cpm_example main.cpp)
target_link_libraries(cpm_example
PRIVATE
aws-cpp-sdk-core
aws-cpp-sdk-s3)
that will show
|
Hi @sbiscigl, perfect. It works. Thanks. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Hi,
How to use with CPM (cmake package manager)?
Im using this but it include entire SDK and not only S3:
Can anyone help me?
Thanks.
Regression Issue
Expected Behavior
Build only the selected libraries
Current Behavior
Building the role SDK
Reproduction Steps
rm -rf build/
mkdir -p build/
cd build &&
cmake ../ &&
make
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
1.11.505
Compiler and Version used
Apple clang version 16.0.0 (clang-1600.0.26.6)
Operating System and version
macos
The text was updated successfully, but these errors were encountered: