Skip to content

The revised CMakeList.txt does not work #48

Closed

Description

@miryee

aws-lambda-cpp builds using the previous version of CMakeList.txt with:
target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES})

And produces errors using the newly release version with:
target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)

The output for the second version is:

-- Configuring done
CMake Error at CMakeLists.txt:13 (add_library):
  Target "aws-lambda-runtime" links to target "CURL::libcurl" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:13 (add_library):
  Target "aws-lambda-runtime" links to target "CURL::libcurl" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

-- Generating done
-- Build files have been written to: /github/aws-lambda-cpp/built

Activity

  1. marcomagdy commented on Jun 13, 2019

    @marcomagdy
    Contributor

    What version of CMake are you using?

  2. marcomagdy commented on Jun 14, 2019

    @marcomagdy
    Contributor

    Looks like the imported target CURL::libcurl was introduced in CMake 3.12
    (See Kitware/CMake@83c0cb3)
    And the CMake version that apt provides in Ubuntu 18.04 is CMake 3.10.2

  3. marcomagdy commented on Jun 14, 2019

    @marcomagdy
    Contributor

    I will revert the change. Meanwhile, I recommend using the latest CMake. And since apt never provides the latest version (unlike Homebrew), you can follow the steps here https://askubuntu.com/a/865294 to upgrade.
    Note that upgrading CMake is almost always a good idea since it's not a library on which other applications depend on. So, you will not break anything by upgrading.

  4. miryee commented on Jun 14, 2019

    @miryee
    Author

    I am using cmake version 3.10.2-1ubuntu2,

  5. mrahman4 commented on Jun 20, 2019

    @mrahman4

    I've the same issue. Should I use the commit#0bcaf3d?

  6. marcomagdy commented on Jun 20, 2019

    @marcomagdy
    Contributor

    You can. Or better yet upgrade the CMake version on your machine?
    see https://github.com/awslabs/aws-lambda-cpp/blob/master/ci/docker/ubuntu-linux-18.04#L5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions