share/hedgewars/Data/Music/CMakeLists.txt
changeset 564 17fb45c670c1
parent 563 5131c641073f
child 782 e2d2b84aa776
--- a/share/hedgewars/Data/Music/CMakeLists.txt	Fri Jul 20 13:46:27 2007 +0000
+++ b/share/hedgewars/Data/Music/CMakeLists.txt	Fri Jul 20 19:04:24 2007 +0000
@@ -5,25 +5,28 @@
 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(PlayListLength GREATER 0)
+	file(APPEND ${PlayListINCFile} "{$DEFINE HAVE_MUSIC}")
+	file(APPEND ${PlayListINCFile} "playlist: array[0..Pred(cPlayListLength)] of string = (")
 	
-	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;")
-
+	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;")
+endif(PlayListLength GREATER 0)
 
 install(FILES
 	${BaseMusic}