I would be glad if you give me such tho. Mine is literally unbuildable.
Having something like this :
cmake_minimum_required(VERSION 4.0)
project(prj)
set(CMAKE_CXX_STANDARD 20)
add_executable(prj src/main.cpp)
#============================DOWNLOAD-WEBSOCKET-LIBRARY==========================
set(BUILD_SHARED_LIBS OFF)
include(FetchContent)
FetchContent_Declare(
uWS
GIT_REPOSITORY https://github.com/uNetworking/uWebSockets.git
GIT_TAG v20.73.0
)
FetchContent_MakeAvailable(uWS)
# µWebSockets requires OpenSSL and zlib. Find them on the system.
# OpenSSL::SSL and OpenSSL::Crypto are used for secure connections (WSS).
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
(... other libs, whatever)
#============================END-DOWNLOAD-WEBSOCKET-LIBRARY======================
target_link_libraries(prj PRIVATE
OpenSSL::SSL
OpenSSL::Crypto
ZLIB::ZLIB
uWS
)
what errors into this at compilation stage:
[ 11%] Built target asio
[ 58%] Built target spdlog
[ 64%] Linking CXX executable low_latency_daemon
/usr/sbin/ld: cannot find -luWS: No such file or directory
collect2: error: ld returned 1 exit status
linking it with uWS:uWS just fails just by the same way :
[ 11%] Built target asio
[ 58%] Built target spdlog
[ 64%] Linking CXX executable low_latency_daemon
/usr/sbin/ld: cannot find -luWS:uWS: No such file or directory