@ -4,8 +4,6 @@
# S P D X - L i c e n s e - I d e n t i f i e r : B S D - 2 - C l a u s e
#
# " c a l a m a r e s _ b i n " i s t h e m a i n a p p l i c a t i o n , n o t t o b e c o n f u s e d w i t h
# t h e t a r g e t " c a l a m a r e s " w h i c h i s t h e n o n - G U I l i b r a r y p a r t .
set ( calamaresSources
m a i n . c p p
C a l a m a r e s A p p l i c a t i o n . c p p
@ -36,9 +34,44 @@ include_directories(
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
)
# T r a n s l a t i o n s
add_calamares_translations ( ${ CALAMARES_TRANSLATION_LANGUAGES } )
# # # T R A N S L A T I O N S
#
#
set ( TS_FILES "" )
set ( calamares_i18n_qrc_content "" )
# c a l a m a r e s a n d q t l a n g u a g e f i l e s
foreach ( lang ${ CALAMARES_LANGUAGES } )
foreach ( tlsource "calamares_${lang}" "tz_${lang}" )
if ( EXISTS "${CMAKE_SOURCE_DIR}/lang/${tlsource}.ts" )
set ( calamares_i18n_qrc_content "${calamares_i18n_qrc_content}<file>${tlsource}.qm</file>\n" )
list ( APPEND TS_FILES "${CMAKE_SOURCE_DIR}/lang/${tlsource}.ts" )
endif ( )
endforeach ( )
endforeach ( )
set ( trans_file calamares_i18n )
set ( trans_infile ${ CMAKE_CURRENT_BINARY_DIR } / ${ trans_file } .qrc )
set ( trans_outfile ${ CMAKE_CURRENT_BINARY_DIR } /qrc_ ${ trans_file } .cxx )
configure_file ( ${ CMAKE_SOURCE_DIR } /lang/calamares_i18n.qrc.in ${ trans_infile } @ONLY )
qt5_add_translation ( QM_FILES ${ TS_FILES } )
# 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 }
)
# # # E X E C U T A B L E
#
# " c a l a m a r e s _ b i n " i s t h e m a i n a p p l i c a t i o n , n o t t o b e c o n f u s e d w i t h
# t h e t a r g e t " c a l a m a r e s " w h i c h i s t h e n o n - G U I l i b r a r y p a r t .
#
add_executable ( calamares_bin ${ calamaresSources } calamares.qrc ${ trans_outfile } )
target_include_directories ( calamares_bin PRIVATE ${ CMAKE_SOURCE_DIR } )
set_target_properties ( calamares_bin
@ -81,6 +114,9 @@ install( FILES ${CMAKE_SOURCE_DIR}/data/images/squid.svg
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ D A T A D I R } / i c o n s / h i c o l o r / s c a l a b l e / a p p s
)
# # # T E S T S
#
#
if ( BUILD_TESTING )
# D o n ' t i n s t a l l , t h e s e a r e j u s t f o r e n a b l e _ t e s t i n g
add_executable ( loadmodule testmain.cpp )