2014-08-06 22:43:19 +08:00
|
|
|
if(WINDOWS)
|
|
|
|
set(PLATFORM_LINK websockets)
|
|
|
|
elseif(LINUX)
|
|
|
|
set(PLATFORM_LINK websockets ssl crypto)
|
2014-01-09 19:49:11 +08:00
|
|
|
endif()
|
|
|
|
|
2014-05-02 04:01:51 +08:00
|
|
|
set(COCOS_NETWORK_SRC
|
2014-08-07 14:02:50 +08:00
|
|
|
HttpClient.cpp
|
|
|
|
SocketIO.cpp
|
|
|
|
WebSocket.cpp
|
2013-11-02 18:07:34 +08:00
|
|
|
)
|
|
|
|
|
2014-08-07 13:53:13 +08:00
|
|
|
add_library(network STATIC
|
2014-08-07 14:02:50 +08:00
|
|
|
${COCOS_NETWORK_SRC}
|
2014-08-07 13:53:13 +08:00
|
|
|
)
|
|
|
|
|
2014-08-06 22:43:19 +08:00
|
|
|
if(MSVC)
|
2014-08-07 14:02:50 +08:00
|
|
|
set(COCOS_NETWORK_LINK
|
|
|
|
libcurl_imp
|
2014-05-29 16:30:00 +08:00
|
|
|
${PLATFORM_LINK}
|
|
|
|
)
|
2014-08-06 22:43:19 +08:00
|
|
|
else()
|
2014-08-07 14:02:50 +08:00
|
|
|
set(COCOS_NETWORK_LINK
|
2014-05-29 16:30:00 +08:00
|
|
|
curl
|
2014-08-07 14:02:50 +08:00
|
|
|
${PLATFORM_LINK}
|
2014-05-29 16:30:00 +08:00
|
|
|
)
|
2014-08-06 22:43:19 +08:00
|
|
|
endif()
|
2014-08-07 13:53:13 +08:00
|
|
|
|
|
|
|
target_link_libraries(network
|
|
|
|
${COCOS_NETWORK_LINK}
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(network
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
)
|