@ -31,6 +31,11 @@
# S K I P P E D _ M O D U L E S . D o * * n o t * * u s e S K I P P E D _ M O D U L E S a s t h e n a m e o f
# * s k i p l i s t v a r * , t h i n g s w i l l g e t w e i r d .
#
# D o n o t e t h a t t h e n a m e o f a m o d u l e m u s t b e t h e s a m e a s t h e n a m e o f
# t h e d i r e c t o r y c o n t a i n i n g it ( as documented in src/modules/README.md ) .
# T h i s a p p l i e s t o b o t h C + + a n d P y t h o n m o d u l e s , a n d a l l o w s t h e u s e o f
# t h e s u b d i r e c t o r y a s a p r o x y f o r t h e m o d u l e n a m e i n s i d e .
#
include ( CalamaresAddTranslations )
include ( CalamaresCheckModuleSelection )
@ -46,7 +51,32 @@ function( _calamares_add_module_subdirectory_impl )
set ( SKIPPED_MODULES "" )
set ( MODULE_CONFIG_FILES "" )
# T h e m o d u l e s u b d i r e c t o r y m a y b e g i v e n a s a / b / c , b u t t h e m o d u l e
# n e e d s t o b e i n s t a l l e d a s " c " , s o w e s p l i t o f f a n y i n t e r m e d i a t e
# d i r e c t o r i e s .
#
# C o m p u t e _modulename ( the last directory name ) a n d _ m o d _ d i r
# ( t h e f u l l p a t h t o t h e m o d u l e s o u r c e s ) .
get_filename_component ( _dirname "${SUBDIRECTORY}" DIRECTORY )
if ( _dirname )
# R e m o v e t h e d i r n a m e a n d a n y l e f t o v e r l e a d i n g / s
string ( REGEX REPLACE "^${_dirname}/*" "" _modulename "${SUBDIRECTORY}" )
else ( )
set ( _modulename ${ SUBDIRECTORY } )
endif ( )
# S t r i p a n y r e m a i n i n g /
string ( REGEX REPLACE "/" "" _modulename "${_modulename}" )
set ( _mod_dir "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}" )
# S k i p l i s t c h e c k a p p l i e s t o a l l k i n d s o f m o d u l e s
calamares_check_skip ( ${ _modulename } SKIPPED_MODULES )
if ( SKIPPED_MODULES )
# I f i t ' s s k i p p e d b y i n f r a s t u c t u r e , t h e m e s s a g e a l r e a d y i n c l u d e s t h e m o d u l e
# n a m e . W e d o n ' t n e e d t o d o a n y f u r t h e r c h e c k i n g .
set ( SKIPPED_MODULES "${SKIPPED_MODULES}" PARENT_SCOPE )
return ( )
endif ( )
# I f t h i s s u b d i r e c t o r y h a s a C M a k e L i s t s . t x t , w e a d d _ s u b d i r e c t o r y i t . . .
if ( EXISTS "${_mod_dir}/CMakeLists.txt" )
add_subdirectory ( ${ SUBDIRECTORY } )
@ -70,32 +100,15 @@ function( _calamares_add_module_subdirectory_impl )
# . . . o t h e r w i s e , w e l o o k f o r a m o d u l e . d e s c .
elseif ( EXISTS "${_mod_dir}/module.desc" )
set ( MODULES_DIR ${ CMAKE_INSTALL_LIBDIR } /calamares/modules )
# T h e m o d u l e s u b d i r e c t o r y m a y b e g i v e n a s a / b / c , b u t t h e m o d u l e
# n e e d s t o b e i n s t a l l e d a s " c " , s o w e s p l i t o f f a n y i n t e r m e d i a t e
# d i r e c t o r i e s .
get_filename_component ( _dirname "${SUBDIRECTORY}" DIRECTORY )
if ( _dirname )
# R e m o v e t h e d i r n a m e a n d a n y l e f t o v e r l e a d i n g / s
string ( REGEX REPLACE "^${_dirname}/*" "" _modulename "${SUBDIRECTORY}" )
else ( )
set ( _modulename ${ SUBDIRECTORY } )
endif ( )
set ( MODULE_DESTINATION ${ MODULES_DIR } / ${ _modulename } )
calamares_check_skip ( ${ _modulename } SKIPPED_MODULES )
# R e a d m o d u l e . d e s c , c h e c k t h a t t h e i n t e r f a c e t y p e i s s u p p o r t e d .
#
# _ m o d _ e n a b l e d b o o l e a n i f t h e m o d u l e s h o u l d b e built ( only if the interface is supported )
# _ m o d _ r e a s o n i s a h u m a n - r e a d a b l e e x p l a n a t i o n w h y i t i s n ' t b u i l t
# _ m o d _ t e s t i n g b o o l e a n i f t h e m o d u l e s h o u l d b e a d d e d t o t h e l o a d m o d u l e t e s t s
file ( STRINGS "${_mod_dir}/module.desc" MODULE_INTERFACE REGEX "^interface" )
if ( SKIPPED_MODULES )
# I f i t ' s s k i p p e d b y i n f r a s t u c t u r e , t h e m e s s a g e a l r e a d y i n c l u d e s t h e m o d u l e
# n a m e . W e d o n ' t n e e d t o d o a n y f u r t h e r c h e c k i n g .
set ( SKIPPED_MODULES "${SKIPPED_MODULES}" PARENT_SCOPE )
return ( )
elseif ( MODULE_INTERFACE MATCHES "pythonqt" )
if ( MODULE_INTERFACE MATCHES "pythonqt" )
set ( _mod_enabled ${ Calamares_WITH_PYTHONQT } )
set ( _mod_reason "No PythonQt support" )
set ( _mod_testing OFF )