set(TELNETROOT ${OPENAIR_DIR}/common/utils/telnetsrv )

set(TELNETSRV_SOURCE
    ${TELNETROOT}/telnetsrv.c
    ${TELNETROOT}/telnetsrv_phycmd.c
    ${TELNETROOT}/telnetsrv_proccmd.c
    ${TELNETROOT}/telnetsrv_loader.c
    ${TELNETROOT}/telnetsrv_measurements.c
    )

#set(TELNETSRV_ETHDEVCMD_SOURCE
#    ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c
#    )

add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} )
target_link_libraries(telnetsrv PRIVATE history)

install(TARGETS telnetsrv DESTINATION bin)

if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
     install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/ran_build/build)
endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")