tdesktop/Telegram/cmake/generate_scheme.cmake

39 lines
1.1 KiB
CMake
Raw Normal View History

2019-11-21 11:56:17 +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
2019-11-08 11:08:40 +00:00
function(generate_scheme target_name script scheme_files)
find_package(Python3 REQUIRED)
2020-01-03 04:41:48 +00:00
2019-11-08 11:08:40 +00:00
set(gen_dst ${CMAKE_CURRENT_BINARY_DIR}/gen)
2019-11-25 15:40:59 +00:00
file(MAKE_DIRECTORY ${gen_dst})
2019-12-03 16:11:03 +00:00
set(gen_timestamp ${gen_dst}/scheme.timestamp)
set(gen_files
2019-11-08 11:08:40 +00:00
${gen_dst}/scheme.cpp
${gen_dst}/scheme.h
2019-12-06 08:39:13 +00:00
${gen_dst}/scheme-dump_to_text.cpp
${gen_dst}/scheme-dump_to_text.h
2019-11-08 11:08:40 +00:00
)
2019-12-03 16:11:03 +00:00
2019-11-08 11:08:40 +00:00
add_custom_command(
OUTPUT
2019-12-03 16:11:03 +00:00
${gen_timestamp}
BYPRODUCTS
2019-12-03 16:11:03 +00:00
${gen_files}
2019-11-08 11:08:40 +00:00
COMMAND
${Python3_EXECUTABLE}
2019-11-08 11:08:40 +00:00
${script}
-o${gen_dst}/scheme
${scheme_files}
COMMENT "Generating scheme (${target_name})"
DEPENDS
${script}
${submodules_loc}/lib_tl/tl/generate_tl.py
${scheme_files}
)
2019-12-03 16:11:03 +00:00
generate_target(${target_name} scheme ${gen_timestamp} "${gen_files}" ${gen_dst})
2019-11-08 11:08:40 +00:00
endfunction()