additional_steps.cmake 3.38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# additional_steps.cmake
# Copyright (C) 2016  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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#
############################################################################

# Create a shortcut to linphone.exe in install prefix
if(LINPHONE_BUILDER_TARGET STREQUAL linphone AND WIN32)
	set(SHORTCUT_PATH "${CMAKE_INSTALL_PREFIX}/linphone.lnk")
	set(SHORTCUT_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/linphone.exe")
	set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
	configure_file("${CMAKE_CURRENT_SOURCE_DIR}/configs/desktop/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs" @ONLY)
	add_custom_command(OUTPUT "${SHORTCUT_PATH}"
		COMMAND "cscript" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs"
	)
	add_custom_target(linphone_winshortcut ALL DEPENDS "${SHORTCUT_PATH}" TARGET_linphone_builder)
endif()


# Packaging
if(ENABLE_PACKAGING)
	get_cmake_property(_varnames VARIABLES)
	set(ENABLE_VARIABLES )
	foreach(_varname ${_varnames})
		if(_varname MATCHES "^ENABLE_.*")
			list(APPEND ENABLE_VARIABLES -D${_varname}=${${_varname}})
	    endif()
	endforeach()

	if(LINPHONE_BUILDER_TARGET STREQUAL linphone)
		# Linphone and linphone SDK packages
		linphone_builder_apply_flags()
		linphone_builder_set_ep_directories(linphone_package)
		linphone_builder_expand_external_project_vars()
		ExternalProject_Add(TARGET_linphone_package
			DEPENDS TARGET_linphone_builder
			TMP_DIR ${ep_tmp}
			BINARY_DIR ${ep_build}
Ghislain MARY's avatar
Ghislain MARY committed
55
			SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
56 57
			DOWNLOAD_COMMAND ""
			CMAKE_GENERATOR ${CMAKE_GENERATOR}
58
			CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DOPENH264_VERSION=${OPENH264_VERSION}
59 60 61 62 63 64 65 66 67 68
		)
	elseif((LINPHONE_BUILDER_TARGET STREQUAL ms2) OR (LINPHONE_BUILDER_TARGET STREQUAL ms2-plugins))
		# Mediastreamer SDK packages
		linphone_builder_apply_flags()
		linphone_builder_set_ep_directories(ms2_package)
		linphone_builder_expand_external_project_vars()
		ExternalProject_Add(TARGET_ms2_package
			DEPENDS TARGET_linphone_builder
			TMP_DIR ${ep_tmp}
			BINARY_DIR ${ep_build}
Ghislain MARY's avatar
Ghislain MARY committed
69
			SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/ms2_package"
70 71 72 73 74 75
			DOWNLOAD_COMMAND ""
			CMAKE_GENERATOR ${CMAKE_GENERATOR}
			CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DMS2_SOURCE_DIR=${EP_ms2_SOURCE_DIR} ${ENABLE_VARIABLES}
		)
	endif()
endif()