Commit b404cea4 authored by Ronan's avatar Ronan

feat(linphone_package): clean files architecture

parent 5d8c351d
......@@ -27,7 +27,7 @@ if (LINPHONE_BUILDER_TARGET STREQUAL linphoneqt AND WIN32)
set(SHORTCUT_PATH "${CMAKE_INSTALL_PREFIX}/${EXECUTABLE_NAME}.lnk")
set(SHORTCUT_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}.exe")
set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs" @ONLY)
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/windows/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)
......@@ -35,7 +35,7 @@ if (LINPHONE_BUILDER_TARGET STREQUAL linphoneqt AND WIN32)
set(SHORTCUT_PATH "${CMAKE_SOURCE_DIR}/../../Project.sln.lnk")
set(SHORTCUT_TARGET_PATH "${LINPHONE_BUILDER_WORK_DIR}/cmake/Project.sln")
set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/../..")
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs" @ONLY)
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/windows/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs" @ONLY)
execute_process(COMMAND "cscript" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs")
endif ()
......
......@@ -177,8 +177,8 @@ if (WIN32)
)
endif ()
elseif (APPLE)
configure_file("Info.plist.in" "${APPLICATION_NAME}.app/Contents/Info.plist" @ONLY)
configure_file("linphone.icns" "${APPLICATION_NAME}.app/Contents/Resources/${EXECUTABLE_NAME}.icns" COPYONLY)
configure_file("macos/Info.plist.in" "${APPLICATION_NAME}.app/Contents/Info.plist" @ONLY)
configure_file("macos/linphone.icns" "${APPLICATION_NAME}.app/Contents/Resources/${EXECUTABLE_NAME}.icns" COPYONLY)
file(COPY "${LINPHONE_OUTPUT_DIR}/bin/${EXECUTABLE_NAME}" DESTINATION "${APPLICATION_NAME}.app/Contents/MacOS")
file(GLOB SHARED_LIBRARIES "${LINPHONE_OUTPUT_DIR}/lib/lib*.dylib")
foreach (_library ${SHARED_LIBRARIES})
......@@ -229,8 +229,8 @@ elseif (APPLE)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app" DESTINATION "." USE_SOURCE_PERMISSIONS)
configure_file("MacPackaging.cmake.in" "MacPackaging.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/MacPackaging.cmake")
configure_file("macos/packaging.cmake.in" "packaging.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/packaging.cmake")
endif ()
if (MSVC)
......@@ -267,18 +267,18 @@ set(CPACK_RESOURCE_FILE_LICENSE "${LINPHONE_DESKTOP_DIR}/LICENSE.txt")
if (APPLE)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${LINPHONE_GIT_REVISION}-mac")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/background-dmg.jpg")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/macos/background_dmg.jpg")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/linphone_dmg.scpt.in" "${CMAKE_CURRENT_BINARY_DIR}/linphone_dmg.scpt" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/linphone_dmg.scpt.in" "${CMAKE_CURRENT_BINARY_DIR}/linphone_dmg.scpt" @ONLY)
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/linphone_dmg.scpt")
endif ()
if (WIN32)
# Use magic `NSIS.template.in` template from the current source directory to force uninstallation
# and ensure that linphone is not running before installation.
set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/windows")
set(CPACK_GENERATOR "NSIS")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\banner.bmp")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\windows\\\\banner.bmp")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${LINPHONE_GIT_REVISION}-win32")
set(CPACK_NSIS_MUI_ICON "${LINPHONE_DESKTOP_DIR}/assets/icon.ico")
set(CPACK_NSIS_MUI_UNIICON "${LINPHONE_DESKTOP_DIR}/assets/icon.ico")
......@@ -292,9 +292,9 @@ if (WIN32)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" DOS_STYLE_BINARY_DIR)
string(REPLACE "\\" "\\\\" ESCAPED_DOS_STYLE_BINARY_DIR "${DOS_STYLE_BINARY_DIR}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/uri-handler-install.nsi.in" "${CMAKE_CURRENT_BINARY_DIR}/uri-handler-install.nsi" @ONLY)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "!include \\\"${ESCAPED_DOS_STYLE_BINARY_DIR}\\\\uri-handler-install.nsi\\\"")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/uninstall.nsi.in" "${CMAKE_CURRENT_BINARY_DIR}/uninstall.nsi" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/windows/install.nsi.in" "${CMAKE_CURRENT_BINARY_DIR}/install.nsi" @ONLY)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "!include \\\"${ESCAPED_DOS_STYLE_BINARY_DIR}\\\\install.nsi\\\"")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/windows/uninstall.nsi.in" "${CMAKE_CURRENT_BINARY_DIR}/uninstall.nsi" COPYONLY)
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "!include \\\"${ESCAPED_DOS_STYLE_BINARY_DIR}\\\\uninstall.nsi\\\"")
# Sign the installer.
......@@ -304,7 +304,7 @@ if (WIN32)
get_filename_component(WINSDK_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" REALPATH CACHE)
find_package(PythonInterp)
find_program(SIGNTOOL signtool PATHS ${WINSDK_DIR}/bin)
set(SIGNTOOL_COMMAND "${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/signtool.py")
set(SIGNTOOL_COMMAND "${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/windows/signtool.py")
set(PERFORM_SIGNING 0)
if (EXISTS ${PFX_FILE})
if (SIGNTOOL)
......@@ -319,7 +319,7 @@ if (WIN32)
else ()
message(STATUS "No signtool certificate found; assuming development machine (${PFX_FILE})")
endif ()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/WindowsPackaging.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsPackaging.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/WindowsPackaging.cmake")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/packaging.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/packaging.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/packaging.cmake")
endif ()
include(CPack)
############################################################################
# MacPackaging.cmake
# packaging.cmake
# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
#
############################################################################
......
############################################################################
# WindowsPackaging.cmake
# packaging.cmake
# Copyright (C) 2014-2018 Belledonne Communications, Grenoble France
#
############################################################################
......
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