diff --git a/CalamaresAddBrandingSubdirectory.cmake b/CalamaresAddBrandingSubdirectory.cmake index 7e47d96cd..bc2f6f9c9 100644 --- a/CalamaresAddBrandingSubdirectory.cmake +++ b/CalamaresAddBrandingSubdirectory.cmake @@ -3,10 +3,20 @@ include( CMakeColors ) function( calamares_add_branding_subdirectory ) set( SUBDIRECTORY ${ARGV0} ) - if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/branding.desc" ) + if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/CMakeLists.txt" ) + add_subdirectory( $SUBDIRECTORY ) + message( "-- ${BoldYellow}Found ${CALAMARES_APPLICATION_NAME} branding component: ${BoldRed}${SUBDIRECTORY}${ColorReset}" ) + + elseif( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/branding.desc" ) set( BRANDING_DIR share/calamares/branding ) set( BRANDING_COMPONENT_DESTINATION ${BRANDING_DIR}/${SUBDIRECTORY} ) + if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/lang" ) + message( "-- ${BoldYellow}Warning:${ColorReset} branding component ${BoldRed}${SUBDIRECTORY}${ColorReset} has a translations subdirectory but no CMakeLists.txt." ) + message( "" ) + return() + endif() + # We glob all the files inside the subdirectory, and we make sure they are # synced with the bindir structure and installed. file( GLOB BRANDING_COMPONENT_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" )