Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restinio-0.7.2-full.zip could not be used as CMake external project, in fact it is only suitable for add_subdirectory() to your project #221

Open
Trotzky opened this issue Jul 26, 2024 · 1 comment

Comments

@Trotzky
Copy link

Trotzky commented Jul 26, 2024

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:

CMake Error at CMakeLists.txt:61 (find_package):
  -- Configuring incomplete, errors occurred!
    Found package configuration file:

      D:/Projects/proj/build/local_deps/lib/cmake/restinio/restinio-config.cmake

    but it set restinio_FOUND to FALSE so package "restinio" is considered to
    be NOT FOUND.  Reason given by package:

    The following imported targets are referenced, but are missing:
    llhttp::llhttp_static nonstd::expected-lite

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!

@eao197
Copy link
Member

eao197 commented Jul 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants