Skip to content

referring AWSSDK targets in cmake #953

Closed
@crusader-mike

Description

@crusader-mike

I am updating our codebase to use cmake and having difficulty with linking with AWS SDK (and learning cmake as I go). Apparently there are two ways to reference SDK:

old one (apparently it is deprecated?):

find_package(aws-cpp-sdk-core REQUIRED)
target_link_libraries(mylib PUBLIC aws-cpp-sdk-core)

related find module creates imported target aws-cpp-sdk-core that drags in required dependencies removing some of my headaches (selecting correct ssl library, etc). CMake guidelines suggest using "namespaces" (i.e. target should be named aws-cpp-sdk-core::<smth>), but it is not fatal...

new one:

find_package(AWSSDK REQUIRED)

set(SERVICE s3)
AWSSDK_DETERMINE_LIBS_TO_LINK(SERVICE OUTPUT)
target_link_libraries(mylib PUBLIC ${OUTPUT})

unfortunately it doesn't seem to follow ideas introduced by "modern cmake" -- it doesn't create imported targets, thus forcing me to take care of aws-cpp-sdk-core dependencies (like ssl libs, etc).

I have two questions:

  • what is the officially approved way to go when using AWS SDK from my application CMakeLists.txt?
  • is there any way to find out what given cmake find module does (besides reading it's source code)? (As in "which targets it is going to create?" and "what variables will affect it's behaviour?")

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions