2
0

CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. cmake_minimum_required(VERSION 2.8)
  2. project(zt_osdep)
  3. set(src
  4. Arp.cpp
  5. Http.cpp
  6. EthernetTap.cpp
  7. ManagedRoute.cpp
  8. NeighborDiscovery.cpp
  9. OSUtils.cpp
  10. PortMapper.cpp
  11. PortMapper-miniupnpc.c
  12. PortMapper-libnatpmp.c
  13. )
  14. set(headers
  15. Arp.hpp
  16. Binder.hpp
  17. BlockingQueue.hpp
  18. EthernetTap.hpp
  19. Http.hpp
  20. ManagedRoute.hpp
  21. OSUtils.hpp
  22. Phy.hpp
  23. PortMapper.hpp
  24. Thread.hpp
  25. )
  26. if(WIN32)
  27. set(src ${src} WindowsEthernetTap.cpp)
  28. set(headers ${headers} WindowsEthernetTap.hpp)
  29. elseif(UNIX)
  30. if(APPLE)
  31. set(src ${src} MacEthernetTap.cpp MacKextEthernetTap.cpp)
  32. set(headers ${headers} MacEthernetTap.hpp MacKextEthernetTap.hpp)
  33. endif(APPLE)
  34. if(CMAKE_SYSTEM_NAME MATCHES "BSD")
  35. set(src ${src} BSDEthernetTap.cpp)
  36. set(headers ${headers} BSDEthernetTap.hpp)
  37. endif()
  38. if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
  39. set(src ${src} freebsd_getifmaddrs.c)
  40. set(headers ${headers} freebsd_getifmaddrs.h)
  41. endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
  42. if(CMAKE_SYSTEM_NAME MATCHES "Linux")
  43. set(src ${src} LinuxEthernetTap.cpp LinuxNetLink.cpp)
  44. set(headers ${headers} LinuxEthernetTap.hpp LinuxNetLink.hpp)
  45. endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
  46. endif(WIN32)
  47. add_library(${PROJECT_NAME} STATIC ${src} ${headers})
  48. target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
  49. if(APPLE)
  50. add_executable(MacEthernetTapAgent MacEthernetTapAgent.c MacEthernetTapAgent.h)
  51. target_include_directories(MacEthernetTapAgent PRIVATE ${CMAKE_BINARY_DIR})
  52. endif(APPLE)