-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (61 loc) · 1.85 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
option(PJSETTINGS_USE_EXTERNAL_JSONCPP OFF)
option(PJSETTINGS_USE_EXTERNAL_PUGIXML OFF)
option(PJSETTINGS_NO_TESTS OFF)
project(pjsettings)
include_directories(.)
if (NOT PJSIP_FOUND)
if (UNIX)
add_definitions(-fpermissive)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PJSIP libpjproject REQUIRED)
if (NOT PJSIP_FOUND)
message(SEND_ERROR "PJSIP libraries not found")
return()
endif()
elseif(WIN32)
add_definitions(-DPJ_WIN32=1)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
add_definitions(-DPJ_M_X86_64)
else()
add_definitions(-DPJ_M_I386)
endif()
set (PJSIP_ROOT_DIR $ENV{PJSIP_ROOT})
set (PJSIP_INCLUDE_DIR ${PJSIP_ROOT_DIR}/include)
include_directories(${PJSIP_INCLUDE_DIR})
set (PJSIP_LIBRARY_DIR ${PJSIP_ROOT_DIR}/lib)
link_directories(${PJSIP_LIBRARY_DIR})
set (PJSIP_LIBRARIES "libpjproject")
set (PJSIP_PLATFORM_LIBRARIES "Ws2_32;ole32;wsock32;dsound")
set (PJSIP_STATIC_LIBRARIES ${PJSIP_LIBRARIES} ${PJSIP_PLATFORM_LIBRARIES})
endif()
endif()
set(pjsettings-json
pjsettings-jsoncpp.h
pjsettings-jsoncpp.cpp
)
if (NOT PJSETTINGS_USE_EXTERNAL_JSONCPP)
list(APPEND pjsettings-json
json.h
json-forwards.h
jsoncpp.cpp
)
endif()
source_group(jsoncpp FILES ${pjsettings-json})
set(pjsettings-pugixml
pjsettings-pugixml.h
pjsettings-pugixml.cpp
)
if (NOT PJSETTINGS_USE_EXTERNAL_PUGIXML)
list(APPEND pjsettings-pugixml
pugiconfig.hpp
pugixml.hpp
pugixml.cpp
)
endif()
source_group(pugixml FILES ${pjsettings-pugixml})
add_library(pjsettings ${pjsettings-json} ${pjsettings-pugixml})
if (NOT PJSETTINGS_NO_TESTS)
enable_testing()
add_subdirectory(tests)
endif()