2019-06-20 23:13:52 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
project(zt_osdep)
|
|
|
|
|
|
|
|
set(src
|
|
|
|
Arp.cpp
|
|
|
|
Http.cpp
|
2019-08-12 19:35:07 +00:00
|
|
|
EthernetTap.cpp
|
2019-06-20 23:13:52 +00:00
|
|
|
ManagedRoute.cpp
|
|
|
|
NeighborDiscovery.cpp
|
|
|
|
OSUtils.cpp
|
|
|
|
PortMapper.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(headers
|
|
|
|
Arp.hpp
|
|
|
|
Binder.hpp
|
|
|
|
BlockingQueue.hpp
|
2019-08-12 19:35:07 +00:00
|
|
|
EthernetTap.hpp
|
2019-06-20 23:13:52 +00:00
|
|
|
Http.hpp
|
|
|
|
ManagedRoute.hpp
|
|
|
|
OSUtils.hpp
|
|
|
|
Phy.hpp
|
|
|
|
PortMapper.hpp
|
|
|
|
Thread.hpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(src ${src} WindowsEthernetTap.cpp)
|
|
|
|
set(headers ${headers} WindowsEthernetTap.hpp)
|
|
|
|
elseif(UNIX)
|
|
|
|
if(APPLE)
|
|
|
|
set(src ${src} MacEthernetTap.cpp)
|
|
|
|
set(headers ${headers} MacEthernetTap.hpp)
|
|
|
|
endif(APPLE)
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "BSD")
|
|
|
|
set(src ${src} BSDEthernetTap.cpp)
|
|
|
|
set(headers ${headers} BSDEthernetTap.hpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
set(src ${src} freebsd_getifmaddrs.c)
|
|
|
|
set(headers ${headers} freebsd_getifmaddrs.h)
|
|
|
|
endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
|
2019-06-21 22:16:20 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
set(src ${src} LinuxEthernetTap.cpp LinuxNetLink.cpp)
|
|
|
|
set(headers ${headers} LinuxEthernetTap.hpp LinuxNetLink.hpp)
|
|
|
|
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
2019-06-20 23:13:52 +00:00
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} STATIC ${src} ${headers})
|
2019-08-01 21:36:35 +00:00
|
|
|
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
|
|
|
|
|
2019-08-01 22:41:50 +00:00
|
|
|
if(APPLE)
|
|
|
|
add_executable(MacEthernetTapAgent MacEthernetTapAgent.c MacEthernetTapAgent.h)
|
2019-08-16 16:44:31 +00:00
|
|
|
target_include_directories(MacEthernetTapAgent PRIVATE ${CMAKE_BINARY_DIR})
|
2019-08-01 22:41:50 +00:00
|
|
|
endif(APPLE)
|
|
|
|
|
|
|
|
|