Skip to content

Instantly share code, notes, and snippets.

@wtrsltnk
Last active March 7, 2022 21:11
Show Gist options
  • Save wtrsltnk/b25ce1ee5afbbb7c4988f29e519483c5 to your computer and use it in GitHub Desktop.
Save wtrsltnk/b25ce1ee5afbbb7c4988f29e519483c5 to your computer and use it in GitHub Desktop.
Adding libcurl dependancy with cmake and CPM
include(cmake/CPM.cmake)
CPMAddPackage(
NAME mbedtls
GITHUB_REPOSITORY "ARMmbed/mbedtls"
GIT_TAG "v3.1.0"
OPTIONS
"ENABLE_PROGRAMS OFF"
"ENABLE_TESTING OFF"
)
set(MBEDTLS_INCLUDE_DIRS mbedtls)
set(MBEDTLS_LIBRARY mbedtls)
set(MBEDX509_LIBRARY mbedtls)
set(MBEDCRYPTO_LIBRARY mbedtls)
CPMAddPackage(
NAME curl
GITHUB_REPOSITORY "curl/curl"
GIT_TAG "curl-7_82_0"
OPTIONS
"CMAKE_USE_LIBSSH2 OFF"
"CURL_USE_MBEDTLS ON"
"BUILD_CURL_EXE OFF"
"BUILD_SHARED_LIBS OFF"
"BUILD_TESTING OFF"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment