share/hedgewars/Data/Music/CMakeLists.txt
author unc0rr
Fri, 20 Jul 2007 13:46:27 +0000
changeset 563 5131c641073f
parent 562 d1a9035175ed
child 564 17fb45c670c1
permissions -rw-r--r--
Initial playlists support

file(GLOB BaseMusic *.ogg) 

list(LENGTH BaseMusic PlayListLength)

set(PlayListINCFile ${hedgewars_SOURCE_DIR}/hedgewars/playlist.inc)

file(WRITE ${PlayListINCFile} "const cPlayListLength = " ${PlayListLength} ";")
file(APPEND ${PlayListINCFile} "playlist = array[0..Pred(cPlayListLength)] of string = (")

set(i ${PlayListLength})
foreach(musicfile ${BaseMusic})
	math(EXPR i "${i} - 1")
	
	get_filename_component(relfilename ${musicfile} NAME)
	
	file(APPEND ${PlayListINCFile} '${relfilename}')
	
	if(i GREATER 0)
		file(APPEND ${PlayListINCFile} ",")
	endif(i GREATER 0)
endforeach(musicfile)

file(APPEND ${PlayListINCFile} ");")

file(APPEND ${PlayListINCFile} "var playlistchain = array[0..Pred(cPlayListLength)] of LongWord;")


install(FILES
	${BaseMusic}
	DESTINATION ${SHAREPATH}Data/Music)