tdesktop/Telegram/cmake/generate_lang.cmake

33 lines
895 B
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_lang target_name lang_file)
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}/lang_auto.timestamp)
set(gen_files
2019-11-08 11:08:40 +00:00
${gen_dst}/lang_auto.cpp
${gen_dst}/lang_auto.h
)
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
codegen_lang
-o${gen_dst}
${lang_file}
COMMENT "Generating lang (${target_name})"
DEPENDS
codegen_lang
${lang_file}
)
2019-12-03 16:11:03 +00:00
generate_target(${target_name} lang ${gen_timestamp} "${gen_files}" ${gen_dst})
2019-11-08 11:08:40 +00:00
endfunction()