Commit 7a160e75 authored by François Grisez's avatar François Grisez
Browse files

Add generation of a mediastreamer SDK package on Windows

parents 3401c7ce d07e91b7
......@@ -124,13 +124,12 @@ if(WIN32)
set(EP_vpx_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
endif()
# Create a shortcut to linphone.exe in install prefix
if(WIN32)
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/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs" @ONLY)
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"
)
......@@ -140,16 +139,42 @@ endif()
# Packaging
if (ENABLE_PACKAGING)
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}
DOWNLOAD_COMMAND ""
PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_CURRENT_LIST_DIR}/desktop" "<SOURCE_DIR>"
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DENABLE_ZRTP:BOOL=${ENABLE_ZRTP}
)
# Linphone and linphone SDK packages
if(LINPHONE_BUILDER_TARGET STREQUAL linphone)
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}
DOWNLOAD_COMMAND ""
PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_CURRENT_LIST_DIR}/desktop/linphone_package" "<SOURCE_DIR>"
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DENABLE_ZRTP:BOOL=${ENABLE_ZRTP}
)
endif()
# Mediastreamer SDK packages
if(LINPHONE_BUILDER_TARGET STREQUAL ms2
OR LINPHONE_BUILDER_TARGET STREQUAL ms2-plugins)
if(LINPHONE_BUILDER_TARGET STREQUAL ms2)
set(MS2_PACKAGE_DEPEND_TARGET TARGET_ms2)
else()
set(MS2_PACKAGE_DEPEND_TARGET TARGET_ms2plugins)
endif()
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(ms2_package)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_ms2_package
DEPENDS ${MS2_PACKAGE_DEPEND_TARGET}
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
DOWNLOAD_COMMAND ""
PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_CURRENT_LIST_DIR}/desktop/ms2_package" "<SOURCE_DIR>"
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DENABLE_ZRTP:BOOL=${ENABLE_ZRTP}
)
endif()
endif()
############################################################################
# CMakeLists.txt
# 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.
#
############################################################################
cmake_minimum_required(VERSION 3.0)
project(MS2_PACKAGE) # Dummy project
find_package(Mediastreamer2 REQUIRED)
find_package(Git)
set(MS2_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../EP_ms2")
set(MS2_BUILD_DIR "${CMAKE_BINARY_DIR}/../ms2")
if(GIT_EXECUTABLE)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always
OUTPUT_VARIABLE MS2_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${MS2_SOURCE_DIR}
)
else()
set(MS2_GIT_REVISION "0.0.0")
endif()
install(DIRECTORY ${LINPHONE_OUTPUT_DIR}/
DESTINATION .
PATTERN bin/openh264.* EXCLUDE
)
if(WIN32)
configure_file(WindowsSDKArchiver.cmake.in WindowsSDKArchiver.cmake @ONLY)
install(SCRIPT ${CMAKE_BINARY_DIR}/WindowsSDKArchiver.cmake)
endif()
find_program(7Z_PROGRAM 7z.exe)
set(ARCHIVE_NAME mediastreamer-sdk-@MS2_GIT_REVISION@-win32.zip)
execute_process(
COMMAND ${7Z_PROGRAM} a -tzip @CMAKE_BINARY_DIR@/${ARCHIVE_NAME} .
WORKING_DIRECTORY @CMAKE_INSTALL_PREFIX@
)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment