Open Trotzky opened 4 months ago
Hi! Thanks for reporting.
restinio-0.7.2-full.*
archives are added to simplify experiments with RESTinio for those who wants to run some of RESTinio's examples or/and tests. These archives are not intended to be used as RESTinio's distribution (for tools like CMake's fetch_content).
When RESTinio performs install
operation it doesn't installs dependencies by design. If someone follows Unix-inspired approach where a library is installed somewhere after a successful build, then he/she has to use the same approach for RESTinio's dependencies. So it's not a bug, it's a feature.
restinio-0.7.2-full.zip cannot be used as a separate(external) project because it does not install all it's locally provided dependencies. Also to find shipped asio manual setting of CMAKE_MODULE_PATH is needed to provide path to Findasio.cmake module. But this does not saves the day because llhttp::llhttp_static and nonstd::expected-lite still missing and according to restinio-config.cmake we don't use find_dependency() on them because they are "local".
When llhttp and expected-lite is set to local, Restinio adds them to itself using add_subdirectory() but they are not being installed as part of restinio installation step, so later in other project doing find_package(restinio REQUIRED) we got this:
Possibly local fmt will have similar problems. I am using external fmt with RESTINIO_DEP_FMT == 'find' and it's ok.
Resolving this issue will requre significant amount of build system refactoring. I think we need to use Superbuild pattern here. Just build all dependencies one by one as a separate projectd and install them. Restinio should use them via find_dependency() and add them to Restinio lib target, so any target using Restinio will know about all dependencies.
It will be great to see future Restinio release with this issues resolved!