CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. cmake_minimum_required(VERSION 3.0)
  2. project(ex1
  3. VERSION 0.1
  4. LANGUAGES CXX)
  5. ###########
  6. # Debug or Release
  7. ###########
  8. if (NOT CMAKE_BUILD_TYPE)
  9. ## set default to Debug
  10. set(CMAKE_BUILD_TYPE RelWithDebInfo) # override with -DCMAKE_BUILD_TYPE=Release
  11. message("==> CMAKE_BUILD_TYPE empty. Changing it to Debug.")
  12. else()
  13. message("==> CMAKE_BUILD_TYPE == ${CMAKE_BUILD_TYPE}.")
  14. endif()
  15. ## https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
  16. ## During Debug, use debug version of libstdc++ (asserts on access to invalid iterators, etc!)
  17. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
  18. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
  19. ##############
  20. # C++ Standard
  21. ##############
  22. set(CMAKE_CXX_STANDARD 14)
  23. # set(CMAKE_CXX_STANDARD 17)
  24. set(CMAKE_CXX_EXTENSIONS ON)
  25. ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
  26. # add log_setup log
  27. FIND_PACKAGE( Boost 1.60 COMPONENTS program_options log_setup log REQUIRED )
  28. INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
  29. ADD_EXECUTABLE( twproxy twproxy.cpp config.cpp session.cpp dispatchers.cpp boxes.cpp )
  30. TARGET_LINK_LIBRARIES( twproxy ${Boost_LIBRARIES} pthread )