2020-11-19 20:21:05 +00:00
|
|
|
# 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)
|
|
|
|
|
2022-01-25 11:46:38 +00:00
|
|
|
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
|
2022-01-25 12:11:06 +00:00
|
|
|
file(MAKE_DIRECTORY ${gen_dst})
|
|
|
|
|
|
|
|
set(gen_timestamp ${gen_dst}/${target_name}_appdata_changelog.timestamp)
|
2022-01-25 11:46:38 +00:00
|
|
|
set(gen_files ${appdata_path})
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${gen_timestamp}
|
|
|
|
COMMAND
|
2020-11-19 20:21:05 +00:00
|
|
|
${Python3_EXECUTABLE}
|
|
|
|
${submodules_loc}/build/changelog2appdata.py
|
|
|
|
-c "${changelog_path}"
|
|
|
|
-a "${appdata_path}"
|
|
|
|
-n 10
|
2022-01-25 11:46:38 +00:00
|
|
|
COMMAND
|
|
|
|
echo 1> ${gen_timestamp}
|
2020-11-19 20:21:05 +00:00
|
|
|
COMMENT "Generating AppData changelog (${target_name})"
|
|
|
|
DEPENDS
|
|
|
|
${submodules_loc}/build/changelog2appdata.py
|
|
|
|
${changelog_path}
|
|
|
|
${appdata_path}
|
|
|
|
)
|
2022-01-25 12:11:06 +00:00
|
|
|
generate_target(${target_name} appdata_changelog ${gen_timestamp} "${gen_files}" ${gen_dst})
|
2020-11-19 20:21:05 +00:00
|
|
|
endfunction()
|