summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 65eea474c0659d2cb53a86b699352094df239f5a (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
project(twinkle)

cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)

set(PRODUCT_VERSION "1.9.0")
set(PRODUCT_DATE    "June 1, 2015")

OPTION(WITH_ZRTP	"Enable ZRTP encrypted calls" OFF)
OPTION(WITH_SPEEX	"Enable the Speex codec" OFF)
OPTION(WITH_ILBC	"Enable the iLBC codec" OFF)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

include (CheckIncludeFile)
find_package(Qt4 REQUIRED COMPONENTS QTGUI QT3SUPPORT)
find_package(LibXml2 REQUIRED)
find_package(LibMagic REQUIRED)
find_package(LibSndfile REQUIRED)
find_package(Readline REQUIRED)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(Boost REQUIRED COMPONENTS regex)

find_package(Commoncpp)

if (COMMONCPP_FOUND)
	message(STATUS "commoncpp OK")
	
	include_directories(${COMMONCPP_INCLUDE_DIR})
else (COMMONCPP_FOUND)
	message(FATAL_ERROR "commoncpp not found!")
endif (COMMONCPP_FOUND)

include_directories(${LIBXML2_INCLUDE_DIR} ${QT_QT3SUPPORT_INCLUDE_DIR}
	${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_INCLUDE_DIR})

if (WITH_ALSA)
	find_package(ALSA)

	if (ALSA_FOUND)
		message(STATUS "libasound OK")
		set(HAVE_LIBASOUND TRUE)
	else (ALSA_FOUND)
		message(FATAL_ERROR "libasound not found!")
	endif (ALSA_FOUND)
endif (WITH_ALSA)

if (WITH_ZRTP)
	find_package(Zrtpcpp)
	
	if (ZRTPCPP_FOUND)
		message(STATUS "libzrtpcpp OK")
		set(HAVE_ZRTP TRUE)
		
		include_directories(${ZRTPCPP_INCLUDE_DIR})
	else (ZRTPCPP_FOUND)
		message(FATAL_ERROR "libzrtpcpp not found!")
	endif (ZRTPCPP_FOUND)
	
	#####
	
	find_package(Ccrtp)
	
	if (CCRTP_FOUND)
		message(STATUS "ccrtp OK")
		
		include_directories(${CCRTP_INCLUDE_DIR})
	else (CCRTP_FOUND)
		message(FATAL_ERROR "ccrtp not found!")
	endif (CCRTP_FOUND)
	
	#####
	
	find_package(Ucommon)
	
	if (UCOMMON_FOUND)
		message(STATUS "ucommon OK")
		
		include_directories(${UCOMMON_INCLUDE_DIR})
	else (UCOMMON_FOUND)
		message(FATAL_ERROR "ucommon not found!")
	endif (UCOMMON_FOUND)
endif (WITH_ZRTP)

if (WITH_SPEEX)
	find_package(Speex)
	
	if (SPEEX_FOUND)
		message(STATUS "Speex OK")
		set(HAVE_SPEEX TRUE)
		
		include_directories(${SPEEX_INCLUDE_DIR})
	else (SPEEX_FOUND)
		message(FATAL_ERROR "Speex not found!")
	endif (SPEEX_FOUND)
endif (WITH_SPEEX)

if (WITH_ILBC)
	find_package(Ilbc)
	
	if (ILBC_FOUND)
		message(STATUS "iLBC OK")
		set(HAVE_ILBC TRUE)
		
		include_directories(${ILBC_INCLUDE_DIR})
	else (ILBC_FOUND)
		message(FATAL_ERROR "iLBC not found!")
	endif (ILBC_FOUND)
endif (WITH_ILBC)

check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(linux/types.h HAVE_LINUX_TYPES_H)
check_include_file(linux/errqueue.h HAVE_LINUX_ERRQUEUE_H)

configure_file(twinkle_config.h.in twinkle_config.h)
include_directories("${CMAKE_BINARY_DIR}")

install(FILES
	${CMAKE_CURRENT_SOURCE_DIR}/data/providers.csv
	${CMAKE_CURRENT_SOURCE_DIR}/data/ringtone.wav
	${CMAKE_CURRENT_SOURCE_DIR}/data/ringback.wav
	${CMAKE_CURRENT_SOURCE_DIR}/src/gui/images/twinkle16.png
	${CMAKE_CURRENT_SOURCE_DIR}/src/gui/images/twinkle32.png
	${CMAKE_CURRENT_SOURCE_DIR}/src/gui/images/twinkle48.png
	DESTINATION share/twinkle)
install(FILES
	${CMAKE_CURRENT_SOURCE_DIR}/src/gui/images/twinkle48.png
	DESTINATION share/pixmaps
	RENAME twinkle.png)

add_subdirectory(src)