Commit cfdc43e6 authored by Ghislain MARY's avatar Ghislain MARY

Create shortcut to run linphone from OUTPUT directory when building on Windows.

parent 6771d22c
############################################################################
# additional_steps.cmake
# Copyright (C) 2017 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
# Create a shortcut to linphone.exe in install prefix
if(LINPHONE_BUILDER_TARGET STREQUAL linphoneqt 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}/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(linphoneqt_winshortcut ALL DEPENDS "${SHORTCUT_PATH}" TARGET_linphone_builder)
endif()
Set oWS = WScript.CreateObject("WScript.Shell")
sLinkFile = "@SHORTCUT_PATH@"
Set oLink = oWS.CreateShortcut(sLinkFile)
oLink.TargetPath = "@SHORTCUT_TARGET_PATH@"
oLink.WorkingDirectory = "@SHORTCUT_WORKING_DIRECTORY@"
oLink.Save
......@@ -24,3 +24,5 @@ lcb_external_source_paths("../linphone-desktop")
lcb_dependencies("linphone")
# Add config step for packaging
set(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS "${CMAKE_CURRENT_LIST_DIR}/additional_steps.cmake")
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