Add changelog2appdata into cmake build

This commit is contained in:
Ilya Fedin 2020-11-20 00:21:05 +04:00 committed by John Preston
parent 64c791a9ce
commit cc35653c2c
2 changed files with 26 additions and 0 deletions

View File

@ -33,6 +33,7 @@ include(cmake/td_mtproto.cmake)
include(cmake/td_lang.cmake)
include(cmake/td_scheme.cmake)
include(cmake/td_ui.cmake)
include(cmake/generate_appdata_changelog.cmake)
set_target_properties(Telegram PROPERTIES AUTOMOC ON AUTORCC ON)
@ -1319,6 +1320,7 @@ endif()
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/telegramdesktop.appdata.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.appdata.xml" @ONLY)
generate_appdata_changelog(Telegram "../changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.appdata.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "telegram.png")

View File

@ -0,0 +1,24 @@
# This file is part of Telegram Desktop,
# the official desktop application for the Telegram messaging service.
#
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
function(generate_appdata_changelog target_name changelog_path appdata_path)
find_package(Python3 REQUIRED)
add_custom_target(${target_name}_appdata_changelog
${Python3_EXECUTABLE}
${submodules_loc}/build/changelog2appdata.py
-c "${changelog_path}"
-a "${appdata_path}"
-n 10
COMMENT "Generating AppData changelog (${target_name})"
DEPENDS
${submodules_loc}/build/changelog2appdata.py
${changelog_path}
${appdata_path}
VERBATIM
)
add_dependencies(${target_name} ${target_name}_appdata_changelog)
endfunction()