Rely on CMake if the branding component has a CMakeLists.txt.

This commit is contained in:
Teo Mrnjavac 2015-05-13 12:31:37 +02:00
parent 45f2bb10a2
commit f10dc62efc

View File

@ -3,10 +3,20 @@ include( CMakeColors )
function( calamares_add_branding_subdirectory ) function( calamares_add_branding_subdirectory )
set( SUBDIRECTORY ${ARGV0} ) 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_DIR share/calamares/branding )
set( BRANDING_COMPONENT_DESTINATION ${BRANDING_DIR}/${SUBDIRECTORY} ) 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 # We glob all the files inside the subdirectory, and we make sure they are
# synced with the bindir structure and installed. # synced with the bindir structure and installed.
file( GLOB BRANDING_COMPONENT_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" ) file( GLOB BRANDING_COMPONENT_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" )