CMakeLists.txt 4.75 KB
Newer Older
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
set(BASE_SOURCE_FILES
	base/eventqueue.c
	base/mscommon.c
	base/msfilter.c
	base/msqueue.c
	base/mssndcard.c
	base/msticker.c
	base/mswebcam.c
	base/mtu.c
	otherfilters/itc.c
	otherfilters/join.c
	otherfilters/tee.c
	otherfilters/void.c
)

set(BASE_GENERATED_SOURCE_FILES
	${CMAKE_CURRENT_BINARY_DIR}/basedescs.h
)
execute_process(
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND awk -f ../extract-filters-names.awk ${BASE_SOURCE_FILES}
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/basedescs.txt
)
execute_process(
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND awk -f ../define-filters.awk
	INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/basedescs.txt
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/basedescs-tmp1.h
)
execute_process(
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND awk -f ../define-ms_base_filter_descs.awk
	INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/basedescs.txt
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/basedescs-tmp2.h
)
execute_process(
	COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/basedescs-tmp1.h ${CMAKE_CURRENT_BINARY_DIR}/basedescs-tmp2.h
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/basedescs.h
)

add_definitions(
	-DMEDIASTREAMER2_EXPORTS
	-DMEDIASTREAMER2_INTERNAL_EXPORTS
	-DHAVE_SPEEXDSP
	-DORTP_INET6
	-D_TRUE_TIME
	-DMS2_INTERNAL
	-DMS2_FILTERS
)

if(WIN32)
add_definitions(
	-DWINDOW_NATIVE
)

set(BASE_LIBS ws2_32 ole32 oleaut32 winmm uuid)
endif(WIN32)
set(BASE_LIBS ${LIBS} libortp)

add_library(libmediastreamer_base SHARED ${BASE_SOURCE_FILES} ${BASE_GENERATED_SOURCE_FILES})
set_target_properties(libmediastreamer_base PROPERTIES VERSION 2.9.2 SOVERSION 3)

target_link_libraries(libmediastreamer_base ${BASE_LIBS})

install(TARGETS libmediastreamer_base
		COMPONENT COMP_libmediastreamer2
        DESTINATION ${LIB_INSTALL_DIR}
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

if(USE_INSTALLED_COMPONENTS)
	add_dependencies(libmediastreamer_base INSTALL_libortp)
endif()



set(VOIP_SOURCE_FILES
	audiofilters/alaw.c
	audiofilters/audiomixer.c
	audiofilters/chanadapt.c
	#audiofilters/devices.c
	#audiofilters/devices.h
	audiofilters/dtmfgen.c
	audiofilters/equalizer.c
	#audiofilters/genericplc.c
	#audiofilters/gsm.c
	audiofilters/l16.c
	audiofilters/msconf.c
	audiofilters/msfileplayer.c
	audiofilters/msfilerec.c
	audiofilters/msg722.c
	audiofilters/msresample.c
	audiofilters/msspeex.c
	audiofilters/msvolume.c
	audiofilters/speexec.c
	audiofilters/tonedetector.c
	audiofilters/ulaw.c
	audiofilters/waveheader.h
	audiofilters/winsnd3.c
	otherfilters/msrtp.c
100 101
	audiofilters/flowcontrol.c
	audiofilters/flowcontrol.h
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
	utils/_kiss_fft_guts.h
	utils/dsptools.c
	utils/g711common.h
	utils/g722.h
	utils/g722_decode.c
	utils/g722_encode.c
	utils/kiss_fft.c
	utils/kiss_fft.h
	utils/kiss_fftr.c
	utils/kiss_fftr.h
	voip/audioconference.c
	voip/audiostream.c
	voip/bitratecontrol.c
	voip/bitratedriver.c
	voip/ice.c
	#voip/layouts.c
	voip/mediastream.c
	voip/msvoip.c
	voip/private.h
	voip/qosanalyzer.c
	voip/qualityindicator.c
	voip/ringstream.c
	voip/rfc3984.c
)

127 128 129 130
if(MS2_ENABLE_OPUS)
set(VOIP_SOURCE_FILES ${VOIP_SOURCE_FILES} audiofilters/msopus.c)
endif(MS2_ENABLE_OPUS)

131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
set(VOIP_GENERATED_SOURCE_FILES
	${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
)
execute_process(
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND awk -f ../extract-filters-names.awk ${VOIP_SOURCE_FILES}
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/voipdescs.txt
)
execute_process(
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND awk -f ../define-filters.awk
	INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/voipdescs.txt
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/voipdescs-tmp1.h
)
execute_process(
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	COMMAND awk -f ../define-ms_voip_filter_descs.awk
	INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/voipdescs.txt
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/voipdescs-tmp2.h
)
execute_process(
	COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/voipdescs-tmp1.h ${CMAKE_CURRENT_BINARY_DIR}/voipdescs-tmp2.h
	OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
)

if(WIN32)
set(VOIP_LIBS ws2_32 ole32 oleaut32 winmm uuid)
endif(WIN32)
set(VOIP_LIBS ${VOIP_LIBS} libortp libmediastreamer_base libspeex libspeexdsp)
160 161 162
if(MS2_ENABLE_OPUS)
set(VOIP_LIBS ${VOIP_LIBS} ${LIBOPUS})
endif(MS2_ENABLE_OPUS)
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178

add_library(libmediastreamer_voip SHARED ${VOIP_SOURCE_FILES} ${VOIP_GENERATED_SOURCE_FILES})
set_target_properties(libmediastreamer_voip PROPERTIES VERSION 2.9.2 SOVERSION 3)

target_link_libraries(libmediastreamer_voip ${VOIP_LIBS})

install(TARGETS libmediastreamer_voip
		COMPONENT COMP_libmediastreamer2
        DESTINATION ${LIB_INSTALL_DIR}
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

if(USE_INSTALLED_COMPONENTS)
	add_dependencies(libmediastreamer_voip
		INSTALL_libortp
		INSTALL_libspeex)
endif()