curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Problem building libcurl agaist mbedtls WITHOUT installing the mbedtls build on the build host.

From: Zakrzewski, Jakub via curl-library <curl-library_at_lists.haxx.se>
Date: Sat, 6 Aug 2022 13:49:02 +0000

> I have tried to specify libraries and folders as

> ```
> set(MBEDTLS_INCLUDE_DIRS "something I thought make sense" CACHE STRING "blah foo" FORCE)
> set(MBEDTLS_LIBRARY "something I thought make sense" CACHE STRING "blah foo" FORCE)
> set(MBEDX509_LIBRARY "something I thought make sense" CACHE STRING "blah foo" FORCE)
> set(MBEDCRYPTO_LIBRARY "something I thought make sense" CACHE STRING "blah foo" FORCE)
> ```
>
> in the CMakeFile.txt that includes curl as a sub_directory but in vain.

This is tricky because curl does not check for possible target but always looks for installed copy (something we should improve).
What you've done here should at least keep CMake happy but will probably fail during compilation because curl will try to link to mbedtls libraries that might not exist yet as the build order is not deterministic unless you also set up some dependencies.
You'd either need to patch curl CMake to use the embedtls target or maybe settle on a superbuild pattern with ExternalProjexxt_Add.

BTW: Instead of custom scripts for downloading the external sources, you could use CMake's FetchContent.


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-08-06