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
|
|
|
|
td/net/SslFd.cpp
|
|
|
|
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
|
|
|
|
td/net/SslFd.h
|
|
|
|
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}>)
|
|
|
|
target_include_directories(tdnet SYSTEM PUBLIC $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
|
2018-02-17 22:24:34 +01:00
|
|
|
target_link_libraries(tdnet PUBLIC tdutils tdactor ${OPENSSL_LIBRARIES} PRIVATE ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES})
|
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
|
|
|
|
)
|