Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k stars 93 forks source link

find_package(restinio CONFIG REQUIRED) does not work with Conan #71

Closed guteksan closed 4 years ago

guteksan commented 4 years ago

I am trying to use restinio from Conan. I followed the example:

https://github.com/Stiffstream/restinio-conan-example

and conan downloaded restinio to my local cache, but when running cmake I get following error:

CMake Error at CMakeLists.txt:8 (find_package):
Could not find a configuration file for package "restinio" that is compatible with requested version "".

The following configuration files were considered but not accepted:

  C:/Users/gutkowsp/.conan/data/restinio/0.5.1/stiffstream/stable/package/29e7dd394d805c02bbd9f6b97f9588be7987fab0/lib/cmake/restinio/restinio-config.cmake, version: 0.4.8 (64bit)

First of all, the version number specified in restinio-config-version.cmake in conan package (0.4.8) does not match the downloaded version (0.5.1). This seems to hold for other versions too: in version 0.6.3 restinio-config-version states: 0.6.2. Even if I request version for which matches the config-version entry match, like 0.6.2, the problem still holds:

CMake Error at CMakeLists.txt:8 (find_package):
Could not find a configuration file for package "restinio" that is compatible with requested version "".

The following configuration files were considered but not accepted:

  C:/Users/gutkowsp/.conan/data/restinio/0.6.2/stiffstream/stable/package/686677752cd2fed5e828f59997b7ea3a0eaa9126/lib/cmake/restinio/restinio-config.cmake, version: 0.6.2 (64bit)

Finally, I tried to specify the version in CMakeLists.txt: find_package(restinio 0.6.2 CONFIG REQUIRED)

but the error is still present:

CMake Error at CMakeLists.txt:8 (find_package):
Could not find a configuration file for package "restinio" that is compatible with requested version "0.6.2".

The following configuration files were considered but not accepted:

  C:/Users/gutkowsp/.conan/data/restinio/0.6.2/stiffstream/stable/package/686677752cd2fed5e828f59997b7ea3a0eaa9126/lib/cmake/restinio/restinio-config.cmake, version: 0.6.2 (64bit)

Edit: Added last logs from cmake .. --trace

trace_log.txt

Could you check this, please?

eao197 commented 4 years ago

C:/Users/gutkowsp/.conan/data/restinio/0.6.2/stiffstream/stable/package/686677752cd2fed5e828f59997b7ea3a0eaa9126/lib/cmake/restinio/restinio-config.cmake, version: 0.6.2 (64bit)

I god a similar error in the past because my CMake was trying to use 32-bit version of VC++. So I had to run CMake that way:

cmake -G "Visual Studio 15 2017 Win64" ..

And CMake accepted 64-bit versions of RESTinio and its dependencies.

guteksan commented 4 years ago

Hi eao197 Thank you, your idea solved this problem!

regards