socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

CMakeLists.txt: improve asio detection

Open jg1uaa opened this issue 2 months ago • 0 comments

Current CMakeLists.txt uses find_package(asio CONFIGURE REQUIRED), this makes error like this:

uaa@framboise:~/z/socket.io-client-cpp/xxx$ cmake -DUSE_SUBMODULES=OFF ..
(snip)
CMake Error at CMakeLists.txt:63 (find_package):
  Could not find a package configuration file provided by "asio" with any of
  the following names:

    asioConfig.cmake
    asio-config.cmake

To solve this problem, replace with pkg_check_modules(ASIO required asio). And, all required modules (RapidJSON, websocketpp, asio) are header-only library. target_include_directories is suitable.

Tested on Debian-13 and OpenBSD-7.7, cmake -DUSE_SUBMODULES=OFF ...

jg1uaa avatar Oct 08 '25 13:10 jg1uaa