diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fadf72..6ee984d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,11 @@ if(NOT LIBUV_INCLUDE_DIR) find_path(LIBUV_INCLUDE_DIR uv.h) endif() if(NOT LIBUV_LIBRARY) - find_library(LIBUV_LIBRARY NAMES uv uv1) + if(WIN32) + find_library(LIBUV_LIBRARY NAMES libuv) + else() + find_library(LIBUV_LIBRARY NAMES uv uv1) + endif() endif() add_library(uWS src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp) @@ -38,4 +42,20 @@ install (TARGETS uWS DESTINATION /usr/lib64) install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION /usr/include/uWS) endif (UNIX) -add_subdirectory(examples) +#add_subdirectory(examples) + +if(WIN32) + target_link_libraries (uWS PUBLIC psapi.lib iphlpapi.lib userenv.lib) + install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION include/uWS) + + if(BUILD_SHARED_LIBS) + target_link_libraries (uWS PUBLIC ws2_32.lib) + endif() +endif() + +install( + TARGETS uWS + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) \ No newline at end of file