blob: f68e20fe14f03bf28a621aee3b17d2aba367dfaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
##### prepare instrname.cpp #####################
file( READ "${CMAKE_CURRENT_SOURCE_DIR}/instrname.cpp" _instrname_data )
string( REGEX REPLACE "[^\n]" "" _instrname_len "${_instrname_data}" )
string( LENGTH "+${_instrname_len}" _instrname_len )
set( _instrname_pos 0 )
set( _instrname_l10n "" )
while( _instrname_pos LESS ${_instrname_len} )
# pick line
string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _line "${_instrname_data}" )
string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _instrname_data "${_instrname_data}" )
math( EXPR _instrname_pos "${_instrname_pos}+1" )
# write instrument name
if( "${_line}" MATCHES "\".+\"" )
string( REGEX MATCH "\".+\"" _line "${_line}" )
set( _line "i18n(${_line});" )
else( )
set( _line "" )
endif( )
set( _instrname_l10n "${_instrname_l10n}${_line}\n" )
endwhile( )
file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/instrname.cpp.tde_l10n" "${_instrname_l10n}" )
##### create translation templates ##############
tde_l10n_create_template(
CATALOG "tdemid"
SOURCES "." "instrname.cpp.tde_l10n"
)
tde_l10n_create_template(
CATALOG "desktop_files/tdemid-desktops/"
SOURCES *.desktop
DESTINATION "${CMAKE_SOURCE_DIR}/translations"
)
|