CMakeLists.txt 535 B

123456789101112131415
  1. cmake_minimum_required(VERSION 2.8)
  2. project(ws_server)
  3. set(LISTENERLIB "socket_listener")
  4. set(THREADS_PREFER_PTHREAD_FLAG ON)
  5. find_package(Threads REQUIRED)
  6. set(SOURCES "src/main.cpp" "src/socket_listener.cpp" "src/task_queue.cpp")
  7. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -std=c++17 -pthread")
  8. add_executable(${PROJECT_NAME} ${SOURCES})
  9. add_library(${LISTENERLIB} ${SOURCES})
  10. target_include_directories(${PROJECT_NAME} PRIVATE
  11. "headers"
  12. "headers/interface"
  13. )
  14. target_link_libraries(${PROJECT_NAME} Threads::Threads)