CMakeLists.txt 1.5 KB


option(WITH_LibEvent "Use LibEvent" ON)


########################################################
# Files

SET(spserver_SOURCES
  event_msgqueue.c
  spbuffer.cpp
  spdispatcher.cpp
  speventcb.cpp
  spexecutor.cpp
  sphandler.cpp
  sphttp.cpp
  sphttpmsg.cpp
  spiochannel.cpp
  spioutils.cpp
  splfserver.cpp
  spmsgblock.cpp
  spmsgdecoder.cpp
  sprequest.cpp
  spresponse.cpp
  spserver.cpp
  spsession.cpp
  spsmtp.cpp
  spthreadpool.cpp
  sputils.cpp
)
SET(spserver_HEADERS
  event_msgqueue.h
  spbuffer.hpp
  spdispatcher.hpp
  speventcb.hpp
  spexecutor.hpp
  sphandler.hpp
  sphttp.hpp
  sphttpmsg.hpp
  spiochannel.hpp
  spioutils.hpp
  splfserver.hpp
  spmsgblock.hpp
  spmsgdecoder.hpp
  spporting.hpp
  sprequest.hpp
  spresponse.hpp
  spserver.hpp
  spsession.hpp
  spsmtp.hpp
  spthreadpool.hpp
  sputils.hpp
)

#############################################################

add_library(spserver SHARED ${spserver_SOURCES} ${spserver_HEADERS})

if(WITH_LibEvent)
  find_package(LibEvent)
  if(LibEvent_FOUND)
    include_directories(${LibEvent_INCLUDE_DIR})
    target_link_libraries(spserver ${LIBEVENT_LIB})
    set (USE_LibEvent 1)
  else(LibEvent_FOUND)
    MESSAGE (SEND_ERROR "LibEvent dependency was not found!")
  endif(LibEvent_FOUND)
endif (WITH_LibEvent)


INSTALL(TARGETS spserver
  RUNTIME DESTINATION ${DMAP_BIN_DIR}
  LIBRARY DESTINATION ${DMAP_LIB_DIR}
  ARCHIVE DESTINATION ${DMAP_LIB_DIR}
)