-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (42 loc) · 1.46 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.1)
project(voip_analyzer LANGUAGES C CXX)
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED True)
set (CMAKE_BUILD_TYPE Release)
add_executable(${PROJECT_NAME}
source/main.cpp
source/rtp/g711.h
source/rtp/g711.c
source/capture.cpp
source/capture.h
source/console_ui.cpp
source/console_ui.h
source/packet_crafter.cpp
source/packet_crafter.h
source/sip.cpp
source/sip.h
source/timer.cpp
source/timer.h
source/rtp/codec.h
source/rtp/codec.cpp
source/rtp/decode.h
source/rtp/decode.cpp
source/rtp/rtp.h
source/rtp/rtp.cpp
)
if(WIN32)
#find libtins library on windows
#requires that both the libtins library and the WinPCAP developer pack are stored in the external directory
set (LIBTINS_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external/libtins/include)
set (WINPCAP_DEV_PACK ${CMAKE_SOURCE_DIR}/external/WpdPack/Include)
find_library(LIBTINS tins ${CMAKE_SOURCE_DIR}/external/libtins/build/lib/Release)
find_library(WPCAP wpcap ${CMAKE_SOURCE_DIR}/external/WpdPack/Lib/x64)
find_library(PACKET Packet ${CMAKE_SOURCE_DIR}/external/WpdPack/Lib/x64)
include_directories(${LIBTINS_INCLUDE_DIR} ${WINPCAP_DEV_PACK})
target_link_libraries(${PROJECT_NAME} ${LIBTINS} ${WPCAP} ${PACKET} ws2_32 Iphlpapi)
add_compile_definitions(TINS_STATIC)
else()
#find the libtins library on Linux and other UNIX like operating systems
find_package(libtins REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} tins -pthread)
endif()