Skip to content

Commit

Permalink
Use the namespace package name for libcurl in CMake
Browse files Browse the repository at this point in the history
This is the proper way of going about package dependencies in CMake. It
results in a package-config.cmake file that does not have hard-coded
paths to the package from the machine it was built on.

See https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html
  • Loading branch information
marcomagdy committed Jun 1, 2019
1 parent 1dccd2a commit 7a4eae8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
$<INSTALL_INTERFACE:include>)

find_package(CURL REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
target_include_directories(${PROJECT_NAME} PRIVATE ${CURL_INCLUDE_DIRS})

target_compile_options(${PROJECT_NAME} PRIVATE
Expand Down
4 changes: 4 additions & 0 deletions cmake/aws-lambda-runtime-config.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include(CMakeFindDependencyMacro)

find_dependency(CURL)

include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)

set(AWS_LAMBDA_PACKAGING_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/packager)
Expand Down

0 comments on commit 7a4eae8

Please sign in to comment.