Skip to content

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

@Trotzky

Description

@Trotzky

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions