aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/CMakeLists.txt
blob: 45950540593a7252125187cc480dd4f979501740 (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
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

set(WSCODECS_FILES
  codecs.c
  G711a/G711adecode.c
  G711u/G711udecode.c
  speex/resample.c
)

# Enables visibility in IDEs
file(GLOB EXTRA_CODEC_HEADERS
  codecs.h
  G711a/G711adecode.h G711a/G711atable.h
  G711u/G711udecode.h G711u/G711utable.h
  speex/arch.h
  speex/speex_resampler.h
  speex/stack_alloc.h
)

if(SBC_FOUND)
  set(WSCODECS_FILES ${WSCODECS_FILES} sbc/sbc.c)
endif()

set(wscodecs_LIBS
  ${M_LIBRARIES}
  ${GMODULE2_LIBRARIES}
  ${SBC_LIBRARIES}
  wsutil
)

if(HAVE_SPANDSP)
  list(APPEND WSCODECS_FILES G722/G722decode.c G726/G726decode.c)
  list(APPEND wscodecs_LIBS ${SPANDSP_LIBRARIES})
endif()

add_library(wscodecs ${LINK_MODE_LIB}
  ${WSCODECS_FILES}
  ${CMAKE_BINARY_DIR}/image/libwscodecs.rc
)

set(FULL_SO_VERSION "0.0.0")

set_target_properties(wscodecs PROPERTIES
  PREFIX "lib"
  COMPILE_DEFINITIONS "WS_BUILD_DLL"
  COMPILE_OPTIONS "${WS_WS_WARNINGS_C_FLAGS}"
  LINK_FLAGS "${WS_LINK_FLAGS}"
  VERSION ${FULL_SO_VERSION} SOVERSION 0
  FOLDER "DLLs"
)

if(ENABLE_APPLICATION_BUNDLE)
  set_target_properties(wscodecs PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Frameworks
  )
endif()

target_link_libraries(wscodecs ${wscodecs_LIBS})

if(NOT ${ENABLE_STATIC})
  install(TARGETS wscodecs
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  )
endif()

CHECKAPI(
	NAME
	  codecs
	SWITCHES
	  -g abort -g termoutput -build
	SOURCES
	  ${WSCODECS_FILES}
)