opencoreamr.cmake 2.27 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
############################################################################
# opencoreamr.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
if(LINPHONE_BUILDER_PREBUILT_URL)
	set(EP_opencoreamr_FILENAME "opencoreamr-0.1.3-${LINPHONE_BUILDER_ARCHITECTURE}.zip")
	file(DOWNLOAD "${LINPHONE_BUILDER_PREBUILT_URL}/${EP_opencoreamr_FILENAME}" "${CMAKE_CURRENT_BINARY_DIR}/${EP_opencoreamr_FILENAME}" STATUS EP_opencoreamr_FILENAME_STATUS)
	list(GET EP_opencoreamr_FILENAME_STATUS 0 EP_opencoreamr_DOWNLOAD_STATUS)
	if(NOT EP_opencoreamr_DOWNLOAD_STATUS)
		set(EP_opencoreamr_PREBUILT 1)
	endif()
endif()
31

32 33 34
if(EP_opencoreamr_PREBUILT)
	set(EP_opencoreamr_URL "${CMAKE_CURRENT_BINARY_DIR}/${EP_opencoreamr_FILENAME}")
	set(EP_opencoreamr_BUILD_METHOD "prebuilt")
Ghislain MARY's avatar
Ghislain MARY committed
35
else()
36 37
	set(EP_opencoreamr_URL "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz")
	set(EP_opencoreamr_URL_HASH "MD5=09d2c5dfb43a9f6e9fec8b1ae678e725")
38 39
	set(EP_opencoreamr_CMAKE_OPTIONS )
	set(EP_opencoreamr_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opencoreamr/CMakeLists.txt" "<SOURCE_DIR>")
40
	set(EP_opencoreamr_LINKING_TYPE "-DENABLE_STATIC=YES")
41 42

	if(ENABLE_AMRNB)
43
		list(APPEND EP_opencoreamr_CMAKE_OPTIONS "-DENABLE_AMRNB_DECODER=YES" "-DENABLE_AMRNB_ENCODER=YES")
44
	else()
45
		list(APPEND EP_opencoreamr_CMAKE_OPTIONS "-DENABLE_AMRNB_DECODER=NO" "-DENABLE_AMRNB_ENCODER=NO")
46
	endif()
Ghislain MARY's avatar
Ghislain MARY committed
47
endif()