2018-12-31 20:04:05 +01:00
|
|
|
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
|
|
|
|
|
|
|
if (NOT OPENSSL_FOUND)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
2018-02-17 22:24:34 +01:00
|
|
|
find_package(ZLIB REQUIRED)
|
2018-12-31 20:04:05 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
#SOURCE SETS
|
|
|
|
set(TDNET_SOURCE
|
|
|
|
td/net/GetHostByNameActor.cpp
|
|
|
|
td/net/HttpChunkedByteFlow.cpp
|
|
|
|
td/net/HttpConnectionBase.cpp
|
|
|
|
td/net/HttpContentLengthByteFlow.cpp
|
|
|
|
td/net/HttpFile.cpp
|
|
|
|
td/net/HttpInboundConnection.cpp
|
|
|
|
td/net/HttpOutboundConnection.cpp
|
2018-07-26 15:49:18 +02:00
|
|
|
td/net/HttpProxy.cpp
|
2018-12-31 20:04:05 +01:00
|
|
|
td/net/HttpQuery.cpp
|
|
|
|
td/net/HttpReader.cpp
|
|
|
|
td/net/Socks5.cpp
|
2018-08-15 14:41:42 +02:00
|
|
|
td/net/SslStream.cpp
|
2018-12-31 20:04:05 +01:00
|
|
|
td/net/TcpListener.cpp
|
2018-07-26 02:28:02 +02:00
|
|
|
td/net/TransparentProxy.cpp
|
2018-12-31 20:04:05 +01:00
|
|
|
td/net/Wget.cpp
|
|
|
|
|
|
|
|
td/net/GetHostByNameActor.h
|
|
|
|
td/net/HttpChunkedByteFlow.h
|
|
|
|
td/net/HttpConnectionBase.h
|
|
|
|
td/net/HttpContentLengthByteFlow.h
|
|
|
|
td/net/HttpFile.h
|
|
|
|
td/net/HttpHeaderCreator.h
|
|
|
|
td/net/HttpInboundConnection.h
|
|
|
|
td/net/HttpOutboundConnection.h
|
2018-07-26 15:49:18 +02:00
|
|
|
td/net/HttpProxy.h
|
2018-12-31 20:04:05 +01:00
|
|
|
td/net/HttpQuery.h
|
|
|
|
td/net/HttpReader.h
|
|
|
|
td/net/NetStats.h
|
|
|
|
td/net/Socks5.h
|
2018-08-15 14:41:42 +02:00
|
|
|
td/net/SslStream.h
|
2018-12-31 20:04:05 +01:00
|
|
|
td/net/TcpListener.h
|
2018-07-26 02:28:02 +02:00
|
|
|
td/net/TransparentProxy.h
|
2018-12-31 20:04:05 +01:00
|
|
|
td/net/Wget.h
|
|
|
|
)
|
|
|
|
|
|
|
|
#RULES
|
|
|
|
#LIBRARIES
|
|
|
|
|
|
|
|
add_library(tdnet STATIC ${TDNET_SOURCE})
|
|
|
|
target_include_directories(tdnet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
2018-10-15 10:23:51 +02:00
|
|
|
target_include_directories(tdnet SYSTEM PRIVATE $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
|
|
|
|
target_link_libraries(tdnet PUBLIC tdutils tdactor PRIVATE ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2018-08-15 22:05:06 +02:00
|
|
|
if (WIN32)
|
|
|
|
target_link_libraries(tdnet PRIVATE Crypt32)
|
|
|
|
endif()
|
|
|
|
|
2018-12-31 20:04:05 +01:00
|
|
|
install(TARGETS tdnet EXPORT TdTargets
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
INCLUDES DESTINATION include
|
|
|
|
)
|