@ -215,29 +215,49 @@ calamares_add_test(
$ { g e o i p _ s r c }
)
# B u i l d u p t r a n s l a t i o n s f o r t h i s o n e t e s t
set ( trans_file "localetest" )
set ( trans_infile ${ CMAKE_CURRENT_BINARY_DIR } / ${ trans_file } .qrc )
set ( trans_outfile ${ CMAKE_CURRENT_BINARY_DIR } /qrc_ ${ trans_file } .cxx )
set ( calamares_i18n_qrc_content "<file>localetest_nl.qm</file>" )
configure_file ( ${ CMAKE_SOURCE_DIR } /lang/calamares_i18n.qrc.in ${ trans_infile } @ONLY )
qt5_add_translation ( QM_FILES "${CMAKE_CURRENT_SOURCE_DIR}/testdata/localetest_nl.ts" )
# R u n t h e r e s o u r c e compiler ( rcc_options should already be set )
add_custom_command (
O U T P U T $ { t r a n s _ o u t f i l e }
C O M M A N D " $ { Q t 5 C o r e _ R C C _ E X E C U T A B L E } "
A R G S $ { r c c _ o p t i o n s } - - f o r m a t - v e r s i o n 1 - n a m e $ { t r a n s _ f i l e } - o $ { t r a n s _ o u t f i l e } $ { t r a n s _ i n f i l e }
M A I N _ D E P E N D E N C Y $ { t r a n s _ i n f i l e }
D E P E N D S $ { Q M _ F I L E S }
)
function ( calamares_qrc_translations basename )
set ( NAME ${ ARGV0 } )
set ( options "" )
set ( oneValueArgs SUBDIRECTORY OUTPUT_VARIABLE )
set ( multiValueArgs LANGUAGES )
cmake_parse_arguments ( _qrt "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ ARGN } )
if ( NOT _qrt_OUTPUT_VARIABLE )
set ( _qrt_OUTPUT_VARIABLE "qrc_translations_${basename}" )
endif ( )
set ( translations_qrc_infile ${ CMAKE_CURRENT_BINARY_DIR } / ${ basename } .qrc )
set ( translations_qrc_outfile ${ CMAKE_CURRENT_BINARY_DIR } /qrc_ ${ basename } .cxx )
# M u s t u s e t h i s v a r i a b l e n a m e b e c a u s e o f t h e @ s u b s t i t u t i o n
set ( calamares_i18n_qrc_content "" )
set ( calamares_i18n_ts_filelist "" )
foreach ( lang ${ _qrt_LANGUAGES } )
string ( APPEND calamares_i18n_qrc_content "<file>${basename}_${lang}.qm</file>" )
list ( APPEND calamares_i18n_ts_filelist "${CMAKE_CURRENT_SOURCE_DIR}/${_qrt_SUBDIRECTORY}/${basename}_${lang}.ts" )
endforeach ( )
configure_file ( ${ CMAKE_SOURCE_DIR } /lang/calamares_i18n.qrc.in ${ translations_qrc_infile } @ONLY )
qt5_add_translation ( QM_FILES ${ calamares_i18n_ts_filelist } )
# R u n t h e r e s o u r c e compiler ( rcc_options should already be set )
add_custom_command (
O U T P U T $ { t r a n s l a t i o n s _ q r c _ o u t f i l e }
C O M M A N D " $ { Q t 5 C o r e _ R C C _ E X E C U T A B L E } "
A R G S $ { r c c _ o p t i o n s } - - f o r m a t - v e r s i o n 1 - n a m e $ { b a s e n a m e } - o $ { t r a n s l a t i o n s _ q r c _ o u t f i l e } $ { t r a n s l a t i o n s _ q r c _ i n f i l e }
M A I N _ D E P E N D E N C Y $ { t r a n s l a t i o n s _ q r c _ i n f i l e }
D E P E N D S $ { Q M _ F I L E S }
)
set ( ${ _qrt_OUTPUT_VARIABLE } ${ translations_qrc_outfile } PARENT_SCOPE )
endfunction ( )
calamares_qrc_translations ( localetest OUTPUT_VARIABLE localetest_qrc SUBDIRECTORY testdata LANGUAGES nl )
calamares_add_test (
l i b c a l a m a r e s l o c a l e t e s t
S O U R C E S
l o c a l e / T e s t s . c p p
$ { t r a n s _ o u t f i l e }
$ { lo c a l e t e s t _ q r c }
)
calamares_add_test (