# tcpserver
SET(tcp_SRCS
    commandinterface.cpp
    commandinterface.h
    cbi_help.cpp
    cbi_help.h
    cbi_quit.cpp
    cbi_quit.h
    cbi_shutdown.cpp
    cbi_shutdown.h
    tcpserver.cpp
    tcpserver.h
    tcpserver_export.h
    tcpserver_logger.h
    workerbase.cpp
    workerbase.h
)

SET(tcp_HDRS
)

NGL_ADD_LIBRARY2(tcpserver AAR SV SHARED ${tcp_SRCS})
NGL_TARGET_LINK_LIBRARIES(tcpserver
  PRIVATE
    Qt6::Network
    ngltools
  PUBLIC
    Qt6::Core
    NGLLogger
)
NGL_TARGET_INCLUDE_DIRECTORIES(tcpserver
  INTERFACE
    ${CMAKE_CURRENT_SOURCE_DIR}/../
)
NGL_INSTALL_TARGET(tcpserver)

IF(BUILD_TESTING AND BUILD_SV AND NOT WIN32)
  LIST(APPEND tcp_test_SRCS
    cbi_pingpong.cpp
    cbi_pingpong.h
    cbi_recvfile.cpp
    cbi_recvfile.h
    cbi_sendfile.cpp
    cbi_sendfile.h
    tcpserver_test.cpp
  )

  ADD_EXECUTABLE(tcpserver_test ${tcp_test_SRCS})
  TARGET_LINK_LIBRARIES(tcpserver_test
      Qt6::Core
      Qt6::Network
      tcpserver
      NGLLogger
  )
ENDIF()

