cleanup CMakeLists.txt for bitmaps

This commit is contained in:
Niki Guldbrand 2016-09-21 17:52:41 +02:00 committed by jean-pierre charras
parent d3771d53ef
commit d618bfbae0
1 changed files with 7 additions and 26 deletions

View File

@ -27,6 +27,7 @@
# 1) PNG files are created from SVG files
# 2) CPP files are created from PNG files.
# 3) Object files are created from CPP files.
# 4) A static library is created from the object files
# Step 3) is universal and is done for any builder, whereas steps 1) and 2) are
# optional and depend on MAINTAIN_PNGS being defined in CMake. The reason we
@ -63,9 +64,9 @@ include_directories(
# Plan for three sizes of bitmaps:
# SMALL - for menus
# MID - for toolbars 26 x 26
# BIG - for program icons 48 x 48
# SMALL - for menus - 16 x 16
# MID - for toolbars - 26 x 26
# BIG - for program icons - 48 x 48
# which are given on three basename lists: BMAPS_SMALL, BMAPS_MID,a nd BMAPS_BIG
# respectively. The basename is without file extension and without path.
# A corresponding ${basename}.svg file must exist in 'sources' dir below here.
@ -589,7 +590,7 @@ set( BMAPS_OTHER
# @todo keep these in sync with .bzrignore
set( TMP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tmp" )
set( TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp" )
function( svg2png inputFile outFile pngWidth pngHeight )
#message( "svg2png( inputFile: ${inputFile} outFile: ${outFile} pngWidth: ${pngWidth} pngHeight: ${pngHeight})")
@ -615,7 +616,7 @@ function( png2png inputFile outFile )
add_custom_command(
OUTPUT ${outFile}
# pngcrush all icons without background to remove any extraneous tEXt records.
# pngcrush all icons without background to remove any extraneous text records.
COMMAND ${pngcrush_EXECUTABLE} -rem alla ${inputFile} ${outFile} > ${TMP_DIR}/${bmn}.pngcrush.log
DEPENDS ${inputFile}
@ -716,33 +717,13 @@ if( MAINTAIN_PNGS )
bitmap_dir( 48 48 "${BMAPS_BIG}" )
if(CONVERT_EOL)
# dos2unix is required to convert EOL format (CRLF) to unix EOL format (LF)
set( eol2unix_FOUND FALSE )
if( NOT eol2unix_FOUND )
find_program( eol2unix_EXECUTABLE ${eol2unix_converter} DOC "The EOL to LF converter program." )
if( NOT eol2unix_EXECUTABLE )
message( FATAL_ERROR "Could not find the ${eol2unix_converter} EOL to LF converter program." )
else( NOT eol2unix_EXECUTABLE )
set( eol2unix_FOUND TRUE )
set( eol2unix_EXECUTABLE ${eol2unix_EXECUTABLE}
CACHE FILEPATH "Path and file name of the end of line converter program." )
message( STATUS "The ${eol2unix_converter} EOL to LF converter program found." )
endif( NOT eol2unix_EXECUTABLE )
endif( NOT eol2unix_FOUND )
elseif(APPLE)
#TODO: see if a EOL converted is needed # OSX
endif(CONVERT_EOL)
endif( MAINTAIN_PNGS )
#message( "CPP_LIST: ${CPP_LIST}" )
# a target with no output, just so changes get built
#add_custom_target( make_cpp_files ALL DEPENDS ${CPP_LIST} )
endif( MAINTAIN_PNGS )
set( CPP_LIST "" )
foreach( bmn ${BMAPS_SMALL} )