opus.cmake 2.29 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
############################################################################
# opus.cmake
# Copyright (C) 2014  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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
############################################################################

23 24 25 26 27 28 29 30 31 32 33 34 35
if(LINPHONE_BUILDER_PREBUILT_URL)
	set(EP_opus_FILENAME "opus-1.0.3-${LINPHONE_BUILDER_ARCHITECTURE}.zip")
	file(DOWNLOAD "${LINPHONE_BUILDER_PREBUILT_URL}/${EP_opus_FILENAME}" "${CMAKE_CURRENT_BINARY_DIR}/${EP_opus_FILENAME}" STATUS EP_opus_FILENAME_STATUS)
	list(GET EP_opus_FILENAME_STATUS 0 EP_opus_DOWNLOAD_STATUS)
	if(NOT EP_opus_DOWNLOAD_STATUS)
		set(EP_opus_PREBUILT 1)
	endif()
endif()

if(EP_opus_PREBUILT)
	set(EP_opus_URL "${CMAKE_CURRENT_BINARY_DIR}/${EP_opus_FILENAME}")
	set(EP_opus_BUILD_METHOD "prebuilt")
else()
36 37
	set(EP_opus_URL "http://downloads.xiph.org/releases/opus/opus-1.1.1.tar.gz")
	set(EP_opus_URL_HASH "MD5=cfb354d4c65217ca32a762f8ab15f2ac")
38
	set(EP_opus_EXTERNAL_SOURCE_PATHS "opus" "externals/opus")
39
	set(EP_opus_MAY_BE_FOUND_ON_SYSTEM TRUE)
40
	set(EP_opus_IGNORE_WARNINGS TRUE)
Ghislain MARY's avatar
Ghislain MARY committed
41

Ghislain MARY's avatar
Ghislain MARY committed
42 43
	set(EP_opus_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opus/CMakeLists.txt" "<SOURCE_DIR>")
	list(APPEND EP_opus_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opus/config.h.cmake" "<SOURCE_DIR>")
44
	set(EP_opus_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
45 46 47 48
	set(EP_opus_CMAKE_OPTIONS )
	if(ANDROID AND CMAKE_SYSTEM_PROCESSOR STREQUAL "armeabi-v7a")
		list(APPEND EP_opus_CMAKE_OPTIONS "-DENABLE_INTRINSICS=YES")
	endif()
49
endif()