CMakeLists.txt 623 B

123456789101112131415161718192021
  1. cmake_minimum_required(VERSION 3.0)
  2. set(CMAKE_CXX_STANDARD 11)
  3. add_executable(httpserver_for_ut
  4. HTTPServer.cpp
  5. ServerThread.cpp
  6. main.cpp
  7. )
  8. # httpserver_for_ut use pthread
  9. find_package(Threads)
  10. target_link_libraries(httpserver_for_ut ${CMAKE_THREAD_LIBS_INIT})
  11. # copy httpserver_for_ut to the same directory as the core_ut binary
  12. set_target_properties(httpserver_for_ut
  13. PROPERTIES
  14. OUTPUT_NAME httpserver_for_ut
  15. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
  16. # httpserver_for_ut echo this message to client
  17. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index.html ${CMAKE_BINARY_DIR}/bin/index.html COPYONLY)