Commit c39fe349 authored by Ronan's avatar Ronan

feat(app): rename easily app

parent 8220d45a
......@@ -25,7 +25,18 @@ project(linphoneqt VERSION 4.1.1)
set(APP_LIBRARY app-library)
set(APPLICATION_NAME linphone)
if (NOT DEFINED EXECUTABLE_NAME)
set(EXECUTABLE_NAME linphone)
endif ()
if (NOT DEFINED APPLICATION_NAME)
set(APPLICATION_NAME Linphone)
endif ()
set(APPLICATION_DESCRIPTION "A libre SIP client")
# ------------------------------------------------------------------------------
set(TARGET_NAME linphone-qt)
set(CMAKE_CXX_STANDARD 11)
......@@ -415,29 +426,37 @@ foreach (target ${TARGET_NAME})
)
endforeach ()
configure_file("assets/linphone.desktop.cmake" "linphone.desktop" @ONLY)
if (UNIX AND NOT APPLE)
# Install desktop/icon files.
configure_file("assets/linphone.desktop.cmake" "${EXECUTABLE_NAME}.desktop" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
)
install(FILES "${ASSETS_DIR}/images/linphone_logo.svg"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/"
RENAME "${EXECUTABLE_NAME}.svg"
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/linphone.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
)
install(FILES "${ASSETS_DIR}/images/linphone_logo.svg"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/"
RENAME "linphone.svg"
)
install(DIRECTORY "${ASSETS_DIR}/icons/hicolor"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons"
)
set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128)
foreach (DIR ${ICON_DIRS})
install(FILES "${ASSETS_DIR}/icons/hicolor/${DIR}/apps/linphone.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${DIR}/apps/"
RENAME "${EXECUTABLE_NAME}.png"
)
endforeach ()
endif ()
# ------------------------------------------------------------------------------
# Install rc files.
# ------------------------------------------------------------------------------
install(FILES "${ASSETS_DIR}/linphonerc-factory"
DESTINATION "${CMAKE_INSTALL_DATADIR}/linphone"
DESTINATION "${CMAKE_INSTALL_DATADIR}/${EXECUTABLE_NAME}"
)
set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant")
set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/linphone/assistant")
set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/${EXECUTABLE_NAME}/assistant")
install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc"
DESTINATION "${ASSISTANT_INSTALL_DATADIR}"
......
[Desktop Entry]
Name=Linphone
Name=@APPLICATION_NAME@
GenericName=SIP Phone
Comment=Linphone is a libre SIP client
Comment=@APPLICATION_DESCRIPTION@
Type=Application
Exec=@CMAKE_INSTALL_PREFIX@/bin/linphone %u
Icon=linphone
Exec=@CMAKE_INSTALL_PREFIX@/bin/@EXECUTABLE_NAME@ %u
Icon=@EXECUTABLE_NAME@
Terminal=false
Categories=Network;Telephony;
MimeType=x-scheme-handler/sip-linphone;x-scheme-handler/sip;x-scheme-handler/sips-linphone;x-scheme-handler/sips;
# Translations
Name[ar]=لِنْفُونْ
Name[cs]=Linphone
Name[de]=Linphone
Name[fr]=Linphone
Name[he]=Linphone
Name[hu]=Linphone
Name[it]=Linphone
Name[ja]=Linphone
Name[nb_NO]=Linphone
Name[ru]=Linphone
Name[sr]=Линфон
Name[sv]=Linphone
Name[zh_CN]=Linphone
Name[zh_TW]=Linphone
......@@ -24,6 +24,12 @@ lcb_define_target("linphoneqt" "linphone" "ms2plugins")
lcb_blacklist_dependencies("libxsd" "soci") # linphone do not need them for the moment.
if(NOT WIN32 AND NOT APPLE)
if (NOT WIN32 AND NOT APPLE)
lcb_blacklist_dependencies("turbo-jpeg") # turbo-jpeg is already provided by Qt5 so do not build it.
endif()
endif ()
set(EXECUTABLE_NAME linphone)
string(SUBSTRING ${EXECUTABLE_NAME} 0 1 FIRST_LETTER)
string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
string(REGEX REPLACE "^.(.*)" "${FIRST_LETTER}\\1" APPLICATION_NAME "${EXECUTABLE_NAME}")
......@@ -21,15 +21,15 @@
############################################################################
if (LINPHONE_BUILDER_TARGET STREQUAL linphoneqt AND WIN32)
# Create a shortcut to linphone.exe in install prefix
set(SHORTCUT_PATH "${CMAKE_INSTALL_PREFIX}/linphone.lnk")
set(SHORTCUT_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/linphone.exe")
# Create a shortcut to linphone.exe in install prefix.
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)
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)
# Create a shortcut to the solution file in the top directory
# Create a shortcut to the solution file in the top directory.
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}/../..")
......@@ -59,7 +59,7 @@ if (ENABLE_PACKAGING)
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
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_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DOPENH264_VERSION=${OPENH264_VERSION} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
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_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DOPENH264_VERSION=${OPENH264_VERSION} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY} -DAPPLICATION_NAME=${APPLICATION_NAME} -DEXECUTABLE_NAME=${EXECUTABLE_NAME}
)
endif ()
endif ()
......@@ -5,11 +5,11 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleName</key>
<string>Linphone</string>
<string>@APPLICATION_NAME@</string>
<key>CFBundleDisplayName</key>
<string>Linphone</string>
<string>@APPLICATION_NAME@</string>
<key>CFBundleExecutable</key>
<string>linphone</string>
<string>@EXECUTABLE_NAME@</string>
<key>CFBundleGetInfoString</key>
<string>@PACKAGE_VERSION@, (C) 2011-2018 The linphone team http://www.linphone.org</string>
<key>CFBundleIconFile</key>
......
......@@ -20,9 +20,9 @@
#
############################################################################
if(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*)
execute_process(
COMMAND ${CMAKE_CPACK_COMMAND} -G DragNDrop
RESULT_VARIABLE CPACK_COMMAND_SUCCESS
)
endif()
if (NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*)
execute_process(
COMMAND ${CMAKE_CPACK_COMMAND} -G DragNDrop
RESULT_VARIABLE CPACK_COMMAND_SUCCESS
)
endif ()
......@@ -903,10 +903,10 @@ SectionEnd
; "Program Files" for AllUsers, "My Documents" for JustMe...
Function .onInit
FindWindow $0 "gdkWindowToplevel" "Linphone"
FindWindow $1 "Qt5QWindowOwnDCIcon" "Linphone"
FindWindow $0 "gdkWindowToplevel" "@APPLICATION_NAME@"
FindWindow $1 "Qt5QWindowOwnDCIcon" "@APPLICATION_NAME@"
StrCmp "$0$1" "00" notRunning
MessageBox MB_OK|MB_ICONEXCLAMATION "Linphone is running. Please close it first and restart the installation." /SD IDOK
MessageBox MB_OK|MB_ICONEXCLAMATION "@APPLICATION_NAME@ is running. Please close it first and restart the installation." /SD IDOK
Abort
notRunning:
......@@ -915,7 +915,7 @@ notRunning:
StrCmp $0 "" inst
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"Linphone is already installed. $\n$\nDo you want to continue and uninstall the old version before installing the new one?" \
"@APPLICATION_NAME@ is already installed. $\n$\nDo you want to continue and uninstall the old version before installing the new one?" \
IDOK uninst
Abort
......
############################################################################
# WindowsPackaging.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
# Copyright (C) 2014-2018 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -20,15 +20,15 @@
#
############################################################################
if(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*)
execute_process(
COMMAND ${CMAKE_CPACK_COMMAND} -G NSIS
RESULT_VARIABLE CPACK_COMMAND_SUCCESS
)
if (NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*)
execute_process(
COMMAND ${CMAKE_CPACK_COMMAND} -G NSIS
RESULT_VARIABLE CPACK_COMMAND_SUCCESS
)
if(@PERFORM_SIGNING@)
execute_process(
COMMAND @SIGNTOOL_COMMAND@ @CMAKE_CURRENT_BINARY_DIR@/@CPACK_PACKAGE_FILE_NAME@.exe
)
endif()
endif()
if (@PERFORM_SIGNING@)
execute_process(
COMMAND @SIGNTOOL_COMMAND@ @CMAKE_CURRENT_BINARY_DIR@/@CPACK_PACKAGE_FILE_NAME@.exe
)
endif ()
endif ()
......@@ -24,7 +24,7 @@ on run argv
set statusbar visible to false
set toolbar visible to false
set the bounds to { 300, 100, 1000, 520 }
set position of item "Linphone.app" to { 200, 280 }
set position of item "@APPLICATION_NAME@.app" to { 200, 280 }
set position of item "Applications" to { 500, 280 }
end tell
update without registering applications
......@@ -40,4 +40,3 @@ on run argv
delay 1
end tell
end run
......@@ -4,4 +4,3 @@ lib/linphone*.lib
share/doc/linphone-*
share/Linphone/cmake/*
share/sounds/linphone/*
share/locale/*/LC_MESSAGES/linphone.mo
FindWindow $0 "gdkWindowToplevel" "Linphone"
FindWindow $0 "gdkWindowToplevel" "@APPLICATION_NAME@"
StrCmp $0 0 notRunningInUninstall
MessageBox MB_OK|MB_ICONEXCLAMATION "Linphone is running. Please close it first and restart the uninstall program." /SD IDOK
MessageBox MB_OK|MB_ICONEXCLAMATION "@APPLICATION_NAME@ is running. Please close it first and restart the uninstall program." /SD IDOK
Abort
notRunningInUninstall:
......
WriteRegStr HKCR "sip" "" "URL:sip Protocol"
WriteRegStr HKCR "sip" "URL Protocol" ""
WriteRegExpandStr HKCR "sip\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sip\DefaultIcon" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe"
WriteRegStr HKCR "sip\shell" "" "open"
WriteRegStr HKCR "sip\shell\open" "" "command"
WriteRegStr HKCR "sip\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
WriteRegStr HKCR "sip\shell\open\command" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe $\"%1$\""
WriteRegStr HKCR "sip-linphone" "" "URL:sip-linphone Protocol"
WriteRegStr HKCR "sip-linphone" "URL Protocol" ""
WriteRegExpandStr HKCR "sip-linphone\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sip-linphone\DefaultIcon" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe"
WriteRegStr HKCR "sip-linphone\shell" "" "open"
WriteRegStr HKCR "sip-linphone\shell\open" "" "command"
WriteRegStr HKCR "sip-linphone\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
WriteRegStr HKCR "sip-linphone\shell\open\command" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe $\"%1$\""
WriteRegStr HKCR "sips" "" "URL:sips Protocol"
WriteRegStr HKCR "sips" "URL Protocol" ""
WriteRegExpandStr HKCR "sips\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sips\DefaultIcon" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe"
WriteRegStr HKCR "sips\shell" "" "open"
WriteRegStr HKCR "sips\shell\open" "" "command"
WriteRegStr HKCR "sips\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
WriteRegStr HKCR "sips\shell\open\command" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe $\"%1$\""
WriteRegStr HKCR "sips-linphone" "" "URL:sips-linphone Protocol"
WriteRegStr HKCR "sips-linphone" "URL Protocol" ""
WriteRegExpandStr HKCR "sips-linphone\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sips-linphone\DefaultIcon" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe"
WriteRegStr HKCR "sips-linphone\shell" "" "open"
WriteRegStr HKCR "sips-linphone\shell\open" "" "command"
WriteRegStr HKCR "sips-linphone\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
WriteRegStr HKCR "sips-linphone\shell\open\command" "" "$INSTDIR\bin\@EXECUTABLE_NAME@.exe $\"%1$\""
......@@ -29,5 +29,5 @@ lcb_spec_file("linphoneqt.spec")
lcb_cmake_options("-DENABLE_UPDATE_CHECK=${ENABLE_UPDATE_CHECK}")
# Add config step for packaging
# Add config step for packaging.
set(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS "${CMAKE_CURRENT_LIST_DIR}/additional_steps.cmake")
......@@ -22,4 +22,5 @@
#cmakedefine APPLICATION_NAME "${APPLICATION_NAME}"
#cmakedefine ENABLE_UPDATE_CHECK 1
#cmakedefine EXECUTABLE_NAME "${EXECUTABLE_NAME}"
#cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}"
......@@ -54,7 +54,9 @@ AppController::AppController (int &argc, char *argv[]) {
// App creation.
// ---------------------------------------------------------------------------
QCoreApplication::setApplicationName(APPLICATION_NAME);
// Do not use APPLICATION_NAME here.
// The EXECUTABLE_NAME will be used in qt standard paths. It's our goal.
QCoreApplication::setApplicationName(EXECUTABLE_NAME);
QCoreApplication::setApplicationVersion(LINPHONE_QT_GIT_VERSION);
mApp = new App(argc, argv);
......
......@@ -111,7 +111,7 @@ private:
stderr,
format,
getFormattedCurrentTime().constData(),
domain.empty() ? domain.c_str() : APPLICATION_NAME,
domain.empty() ? domain.c_str() : EXECUTABLE_NAME,
message.c_str()
);
......
......@@ -37,9 +37,9 @@
using namespace std;
namespace {
constexpr char PathAssistantConfig[] = "/linphone/assistant/";
constexpr char PathAssistantConfig[] = "/" EXECUTABLE_NAME "/assistant/";
constexpr char PathAvatars[] = "/avatars/";
constexpr char PathCaptures[] = "/" APPLICATION_NAME "/captures/";
constexpr char PathCaptures[] = "/" EXECUTABLE_NAME "/captures/";
constexpr char PathCodecs[] = "/codecs/";
constexpr char PathLogs[] = "/logs/";
constexpr char PathPlugins[] = "/plugins/";
......@@ -48,8 +48,8 @@ namespace {
constexpr char PathCallHistoryList[] = "/call-history.db";
constexpr char PathConfig[] = "/linphonerc";
constexpr char PathFactoryConfig[] = "/linphone/linphonerc-factory";
constexpr char PathRootCa[] = "/linphone/rootca.pem";
constexpr char PathFactoryConfig[] = "/" EXECUTABLE_NAME "/linphonerc-factory";
constexpr char PathRootCa[] = "/" EXECUTABLE_NAME "/rootca.pem";
constexpr char PathFriendsList[] = "/friends.db";
constexpr char PathMessageHistoryList[] = "/message-history.db";
constexpr char PathZrtpSecrets[] = "/zidcache";
......
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