CMakeLists.txt 7.44 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# CMakeLists.txt
# Copyright (C) 2015  Belledonne Communications, Grenoble France
#
############################################################################
#
# 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
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 21 22
#
############################################################################

23 24 25 26 27 28 29 30 31 32
if(ENABLE_SHARED)
	set(MS2_LIBS_FOR_TESTER mediastreamer_voip mediastreamer_base)
else()
	set(MS2_LIBS_FOR_TESTER mediastreamer_voip-static mediastreamer_base-static)
	if(XV_FOUND)
		list(APPEND MS2_LIBS_FOR_TESTER Xext)
	endif()
endif()


33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
set(SOUND_FILES
	sounds/arpeggio_8000_mono.wav
	sounds/bird_44100_stereo.wav
	sounds/chimes_48000_stereo.wav
	sounds/hello8000.wav
	sounds/hello8000-1s.wav
	sounds/hello16000.wav
	sounds/hello16000-1s.wav
	sounds/hello_opus.mka
	sounds/hello_pcmu.mka
	sounds/laserrocket_16000_mono.wav
	sounds/nylon_48000_mono.wav
	sounds/owl_44100_mono.wav
	sounds/piano_8000_stereo.wav
	sounds/punch_16000_stereo.wav
	sounds/sintel_trailer_opus_h264.mkv
	sounds/sintel_trailer_opus_vp8.mkv
	sounds/sintel_trailer_pcmu_h264.mkv
51 52 53 54 55
	sounds/test_silence_voice_48000.wav
	sounds/test_silence_voice_44100.wav
	sounds/test_silence_voice_32000.wav
	sounds/test_silence_voice_16000.wav
	sounds/test_silence_voice_8000.wav
56 57 58
)

set(SCENARIO_FILES
59 60 61 62 63 64 65 66 67 68
	scenarios/congestion/video-160-120-0f20c60.pcapng
	scenarios/congestion/audio-80-75-0c60.pcapng
	scenarios/congestion/audio-80-75-0f35c95f120.pcapng
	scenarios/congestion/video-160-0-0a5f30.pcapng
	scenarios/congestion/video-160-90-0a5c30.pcapng
	scenarios/pcmu_8k_no_jitter.pcap
	scenarios/rtp-60late-500total.pcapng
	scenarios/firstvalid.pcapng
	scenarios/opus-edge-congestion20_60_40.pcapng
	scenarios/h264_one_nalu_per_frame.pcap
69
	scenarios/h264_one_nalu_per_frame_with_corrupted_idr.pcap
70 71 72
	scenarios/poor_jitter_quality_22_filter.pcapng
	scenarios/rtp-120late-1000total.pcapng
	scenarios/rtp-240late-2000total.pcapng
73
	scenarios/h264_missing_pps_in_second_i_frame.pcap
74 75 76 77
	scenarios/rtp-534late-24loss-7000total.pcapng
	scenarios/secondvalid.pcapng
	scenarios/opus-poor-quality.pcapng
	scenarios/poor_jitter_quality_22.pcapng
78 79
)

Erwan Croze's avatar
Erwan Croze committed
80 81 82 83
set(IMAGE_FILES
	images/qrcodesite.jpg
	images/qrcodesite_screen.jpg
	images/qrcodesite_inclined.jpg
84
	images/qrcodesite_captured.jpg
Erwan Croze's avatar
Erwan Croze committed
85 86
)

87 88 89 90 91
set(RAW_FILES
	raw/h265-iframe
	raw/h265-parameter-sets-frame
)

92
set(IOS_RESOURCES_FILES
93 94
	sounds
	scenarios
Erwan Croze's avatar
Erwan Croze committed
95
	images
96
)
97

98
set(SOURCE_FILES_C
99 100 101 102
	mediastreamer2_adaptive_tester.c
	mediastreamer2_audio_stream_tester.c
	mediastreamer2_basic_audio_tester.c
	mediastreamer2_framework_tester.c
103
	mediastreamer2_neon_tester.c
104 105 106 107
	mediastreamer2_player_tester.c
	mediastreamer2_sound_card_tester.c
	mediastreamer2_tester.c
	mediastreamer2_tester_private.c
108
	mediastreamer2_text_stream_tester.c
109
	mediastreamer2_jitterbuffer_tester.c
110
)
111
set(SOURCE_FILES_CXX mediastreamer2_h26x_tools_tester.cpp)
112
set(SOURCE_FILES_OBJC )
113

114 115 116 117
add_definitions(
	-DBCTBX_LOG_DOMAIN="mediastreamer"
)

118
if(ENABLE_VIDEO)
119
	list(APPEND SOURCE_FILES_C mediastreamer2_video_stream_tester.c)
Erwan Croze's avatar
Erwan Croze committed
120 121 122
	if(ENABLE_QRCODE)
		list(APPEND SOURCE_FILES_C mediastreamer2_qrcode_tester.c)
	endif()
123 124 125
	if(ENABLE_PCAP)
		list(APPEND SOURCE_FILES_C mediastreamer2_codec_impl_testers.c)
	endif()
126
endif()
127
if(APPLE)
128 129 130 131 132
	if (IOS)
		list(APPEND SOURCE_FILES_OBJC mediastreamer2_tester_ios.m)
	else()
		list(APPEND SOURCE_FILES_OBJC mediastreamer2_tester_cocoa.m)
	endif()
133
endif()
134

135
bc_apply_compile_flags(SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
136
bc_apply_compile_flags(SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
137
bc_apply_compile_flags(SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
138

139 140
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")

141
	add_library(mediastreamer2_tester_static STATIC ${SOURCE_FILES_C} ${SOURCE_FILES_CXX})
142 143
	target_include_directories(mediastreamer2_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS} ${ORTP_INCLUDE_DIRS})
	target_link_libraries(mediastreamer2_tester_static ${MS2_LIBS_FOR_TESTER} ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES})
144 145 146 147 148 149

	set(RUNTIME_COMPONENT_SOURCES
		mediastreamer2_tester_windows.cpp
		mediastreamer2_tester_windows.h
	)
	add_library(mediastreamer2_tester_runtime MODULE ${RUNTIME_COMPONENT_SOURCES})
150
	target_include_directories(mediastreamer2_tester_runtime PRIVATE "../../mswinrtvid")	# HACK!!
151 152
	target_link_libraries(mediastreamer2_tester_runtime mediastreamer2_tester_static)
	set_target_properties(mediastreamer2_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE)
153 154
	set_target_properties(mediastreamer2_tester_runtime PROPERTIES LIBRARY_OUTPUT_NAME "BelledonneCommunications.Mediastreamer2.Tester")
	set_target_properties(mediastreamer2_tester_runtime PROPERTIES LINK_FLAGS "/WINMDFILE:BelledonneCommunications.Mediastreamer2.Tester.winmd")
155 156

	install(TARGETS mediastreamer2_tester_runtime
157 158 159
		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
160 161
		PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
	)
162 163 164
	install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BelledonneCommunications.Mediastreamer2.Tester.winmd" DESTINATION lib)
	if(CMAKE_BUILD_TYPE STREQUAL "Debug")
		install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/BelledonneCommunications.Mediastreamer2.Tester.pdb
165
			DESTINATION ${CMAKE_INSTALL_LIBDIR}
166 167 168
			PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
		)
	endif()
169 170

else()
171 172
	if(IOS)
		set_source_files_properties(${IOS_RESOURCES_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
173
		add_executable(mediastreamer2_tester MACOSX_BUNDLE ${IOS_RESOURCES_FILES} ${SOURCE_FILES_C} ${SOURCE_FILES_CXX} ${SOURCE_FILES_OBJC})
174
	else()
175
		add_executable(mediastreamer2_tester ${SOURCE_FILES_C} ${SOURCE_FILES_CXX} ${SOURCE_FILES_OBJC})
176
	endif()
177
	target_include_directories(mediastreamer2_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
178
	target_link_libraries(mediastreamer2_tester ${MS2_LIBS_FOR_TESTER} ${BCTOOLBOX_TESTER_LIBRARIES} ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES})
179 180 181 182
	string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
	if(LINK_FLAGS_STR)
		set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
	endif()
183
	if(NOT IOS)
184 185 186 187 188 189
		install(TARGETS mediastreamer2_tester
			RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
			LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
			ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
			PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
		)
190 191
		install(FILES ${SOUND_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/mediastreamer2_tester/sounds")
		install(FILES ${SCENARIO_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/mediastreamer2_tester/scenarios")
192
		install(FILES ${RAW_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/mediastreamer2_tester/raw")
Erwan Croze's avatar
Erwan Croze committed
193 194 195
		if(ENABLE_VIDEO AND ENABLE_QRCODE)
			install(FILES ${IMAGE_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/mediastreamer2_tester/images")
		endif()
196 197
	endif()

198
endif()
199