@ -110,23 +110,31 @@ function( calamares_add_branding_translations NAME )
endif ( )
endfunction ( )
# U s a g e calamares_add_branding_subdirectory ( <dir> [ SUBDIRECTORIES <dir> ...] )
# U s a g e calamares_add_branding_subdirectory ( <dir> [ NAME <name>] [ SUBDIRECTORIES <dir> ...] )
#
# A d d s a b r a n d i n g c o m p o n e n t f r o m a s u b d i r e c t o r y :
# - i f t h e r e i s a C M a k e L i s t s . t x t , u s e t h a t
# - o t h e r w i s e a s s u m e a " s t a n d a r d " s e t u p w i t h t o p - l e v e l f i l e s a n d a l a n g / d i r f o r t r a n s l a t i o n s
# - i f t h e r e i s a C M a k e L i s t s . t x t , u s e that ( that CMakeLists.txt should
# c a l l s u i t a b l e calamares_add_branding ( ) a n d o t h e r m a c r o s t o i n s t a l l
# t h e b r a n d i n g c o m p o n e n t ) .
# - o t h e r w i s e a s s u m e a " s t a n d a r d " s e t u p w i t h t o p - l e v e l f i l e s a n d a l a n g /
# s u b d i r e c t o r y f o r t r a n s l a t i o n s .
#
# I f N A M E i s g i v e n , t h i s i s u s e d i n s t e a d o f < d i r > a s t h e n a m e o f
# t h e b r a n d i n g c o m p o n e n t . T h i s i s n e e d e d i f < d i r > i s m o r e t h a n
# o n e l e v e l d e e p , o r t o r e n a m e a c o m p o n e n t a s i t g e t s i n s t a l l e d .
#
# I f S U B D I R E C T O R I E S a r e g i v e n , t h e y a r e r e l a t i v e t o < d i r > , a n d a r e
# copied ( one level deep ) t o t h e i n s t a l l l o c a t i o n a s w e l l .
function ( calamares_add_branding_subdirectory SUBDIRECTORY )
cmake_parse_arguments ( _CABS "" "" "SUBDIRECTORIES" ${ ARGN } )
set ( _CABS_NAME "${SUBDIRECTORY}" )
cmake_parse_arguments ( _CABS "" "NAME" "SUBDIRECTORIES" ${ ARGN } )
if ( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/CMakeLists.txt" )
add_subdirectory ( ${ SUBDIRECTORY } )
elseif ( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/branding.desc" )
calamares_add_branding ( ${ SUBDIRECTORY } DIRECTORY ${ SUBDIRECTORY } SUBDIRECTORIES ${ _CABS_SUBDIRECTORIES } )
calamares_add_branding ( ${ _CABS_NAME } DIRECTORY ${ SUBDIRECTORY } SUBDIRECTORIES ${ _CABS_SUBDIRECTORIES } )
if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/lang" )
calamares_add_branding_translations ( ${ SUBDIRECTORY } DIRECTORY ${ SUBDIRECTORY } )
calamares_add_branding_translations ( ${ _CABS_NAME } DIRECTORY ${ SUBDIRECTORY } )
endif ( )
else ( )
message ( "-- ${BoldYellow}Warning:${ColorReset} tried to add branding component subdirectory ${BoldRed}${SUBDIRECTORY}${ColorReset} which has no branding.desc." )