first release of translation facility
* runtime - loading and translating * design-time - works with *.ts file (pip_tr utility) * compile-time - CMake macro for compile *.ts
This commit is contained in:
@@ -18,6 +18,14 @@
|
||||
Generate C++ files for resource file
|
||||
You should add ${<out_var>} to your target
|
||||
|
||||
|
||||
|
||||
pip_translation(<out_var> ts_file)
|
||||
|
||||
Generate *.btf (binary translation file) from *.ts file
|
||||
You should add ${<out_var>} to your target and then install it to somewhere
|
||||
for later loading in runtime by PITranslator
|
||||
|
||||
]]
|
||||
|
||||
|
||||
@@ -119,3 +127,34 @@ macro(pip_resources RESULT INPUT)
|
||||
VERBATIM)
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(pip_translation RESULT INPUT)
|
||||
#message(STATUS "src = ${CCM_SRC}")
|
||||
#message(STATUS "result = ${RESULT}")
|
||||
#message(STATUS "options = \"${CCM_OPTS}\"")
|
||||
get_filename_component(BTF_FILENAME "${INPUT}" NAME_WE)
|
||||
set(BTF_FILENAME "${BTF_FILENAME}.btf")
|
||||
set(BTF_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BTF_FILENAME})
|
||||
list(APPEND ${RESULT} "${BTF_OUTPUT}")
|
||||
if(IS_ABSOLUTE "${INPUT}")
|
||||
set(IN_FILES "${INPUT}")
|
||||
else()
|
||||
set(IN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT}")
|
||||
endif()
|
||||
#message(STATUS "CCM = ${RESULT}")
|
||||
if(NOT DEFINED PIP_DLL_DIR)
|
||||
set(PIP_DLL_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
#message("PIP_TR: ${PIP_TR}")
|
||||
#message("BTF_OUTPUT: ${BTF_OUTPUT}")
|
||||
#message("IN_FILES: ${IN_FILES}")
|
||||
#message("PIP_DLL_DIR: ${PIP_DLL_DIR}")
|
||||
add_custom_command(OUTPUT ${BTF_OUTPUT}
|
||||
COMMAND ${PIP_TR}
|
||||
ARGS -C -o "${BTF_OUTPUT}" "${IN_FILES}"
|
||||
DEPENDS ${IN_FILES}
|
||||
WORKING_DIRECTORY ${PIP_DLL_DIR}
|
||||
COMMENT "Generating ${BTF_FILENAME}"
|
||||
VERBATIM)
|
||||
endmacro()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user