#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

add_definitions(
  -DPOSIX
)

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../../..
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
)


##### cricketp2pbase (static) ###################

tde_add_library( cricketp2pbase STATIC_PIC
  SOURCES
    stun.cpp port.cpp udpport.cpp tcpport.cpp helpers.cpp sessionmanager.cpp
    session.cpp p2psocket.cpp relayport.cpp stunrequest.cpp stunport.cpp
    socketmanager.cpp
)


##### relayserver (executable) ##################

tde_add_executable( relayserver
  SOURCES
    relayserver.cpp relayserver_main.cpp
  LINK
    cricketbase-static cricketp2pbase-static pthread
  DESTINATION ${BIN_INSTALL_DIR}
)


##### stunserver (executable) ###################

tde_add_executable( stunserver
  SOURCES
    stunserver.cpp stunserver_main.cpp
  LINK
    cricketbase-static cricketp2pbase-static pthread
  DESTINATION ${BIN_INSTALL_DIR}
)
