Initial playlists support
authorunc0rr
Fri, 20 Jul 2007 13:46:27 +0000
changeset 563 5131c641073f
parent 562 d1a9035175ed
child 564 17fb45c670c1
Initial playlists support
share/hedgewars/Data/Music/CMakeLists.txt
--- a/share/hedgewars/Data/Music/CMakeLists.txt	Fri Jul 20 12:25:40 2007 +0000
+++ b/share/hedgewars/Data/Music/CMakeLists.txt	Fri Jul 20 13:46:27 2007 +0000
@@ -1,5 +1,30 @@
 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)