Support installing the package with CMake FetchContent

Open
#196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cmake, cpp
Domain
build-system

Research direction

Start by reproducing the provided CMake FetchContent snippet and inspect the package's CMake integration for how aws_lambda_package_target is exposed. Done means the example configures without the parse error and can link aws-lambda-cpp::aws-lambda-runtime and invoke the packaging command.

Written by the indexing model from the issue text.

Description

Example snippet:

set(BUILD_SHARED_LIBS ON)
FetchContent_Declare(
  aws-lambda-cpp
  GIT_REPOSITORY https://github.com/awslabs/aws-lambda-cpp.git
  GIT_TAG v0.2.10
  GIT_SHALLOW TRUE
  OVERRIDE_FIND_PACKAGE TRUE
)
unset(BUILD_SHARED_LIBS CACHE)

find_package(aws-lambda-cpp)

target_link_libraries(${PROJECT_NAME} PRIVATE aws-lambda-cpp::aws-lambda-runtime)

aws_lambda_package_target(${PROJECT_NAME} NO_LIBC)

Currently fails with the following error:

CMake Error at CMakeLists.txt:48:
  Parse error.  Expected a command name, got unquoted argument with text
  "aws-lambda-cpp::aws_lambda_package_target".
Dominant language
C++
Stars
465
Forks
98
Avg merge
1h 16m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from awslabs/aws-lambda-cpp

All issues in awslabs/aws-lambda-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.