uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 267 forks source link

WIP: build(uwebsockets): add cmakelists #229

Open Napolitain opened 1 month ago

Napolitain commented 1 month ago

Suggesting a CMakeLists.txt file for easily building the project. CMake also integrates well with vcpkg (inside IDE notably). This worked for me when building uWebSockets on Windows (with MSVC!).

ran with (through CLion) :

"D:\Program Files\Jetbrains\CLion Nova\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=D:/Program Files/Jetbrains/CLion Nova/bin/ninja/win/x64/ninja.exe" "-DCMAKE_C_COMPILER=D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe" "-DCMAKE_CXX_COMPILER=D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe" -DCMAKE_TOOLCHAIN_FILE=C:\Users\-\.vcpkg-clion\vcpkg\scripts\buildsystems\vcpkg.cmake -DWITH_LIBUV:BOOL=ON -G Ninja -S D:\Repos\- -B D:\Repos\-\cmake-build-debug
"D:\Program Files\Jetbrains\CLion Nova\bin\cmake\win\x64\bin\cmake.exe" --build D:\Repos\-\cmake-build-release --target HelloWorld -j 26

also : https://github.com/uNetworking/uWebSockets/pull/1788