share/hedgewars/Data/Music/CMakeLists.txt
author unc0rr
Fri, 20 Jul 2007 19:04:24 +0000
changeset 564 17fb45c670c1
parent 563 5131c641073f
child 782 e2d2b84aa776
permissions -rw-r--r--
Finalize basic playlists implementation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
562
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
     1
file(GLOB BaseMusic *.ogg) 
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
     2
563
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     3
list(LENGTH BaseMusic PlayListLength)
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     4
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     5
set(PlayListINCFile ${hedgewars_SOURCE_DIR}/hedgewars/playlist.inc)
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     6
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     7
file(WRITE ${PlayListINCFile} "const cPlayListLength = " ${PlayListLength} ";")
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     8
564
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
     9
if(PlayListLength GREATER 0)
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    10
	file(APPEND ${PlayListINCFile} "{$DEFINE HAVE_MUSIC}")
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    11
	file(APPEND ${PlayListINCFile} "playlist: array[0..Pred(cPlayListLength)] of string = (")
563
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    12
	
564
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    13
	set(i ${PlayListLength})
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    14
	foreach(musicfile ${BaseMusic})
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    15
		math(EXPR i "${i} - 1")
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    16
		
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    17
		get_filename_component(relfilename ${musicfile} NAME)
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    18
		
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    19
		file(APPEND ${PlayListINCFile} '${relfilename}')
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    20
		
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    21
		if(i GREATER 0)
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    22
			file(APPEND ${PlayListINCFile} ",")
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    23
		endif(i GREATER 0)
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    24
	endforeach(musicfile)
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    25
	
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    26
	file(APPEND ${PlayListINCFile} ");")
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    27
	
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    28
	file(APPEND ${PlayListINCFile} "var playlistchain: array[0..Pred(cPlayListLength)] of LongWord;")
17fb45c670c1 Finalize basic playlists implementation
unc0rr
parents: 563
diff changeset
    29
endif(PlayListLength GREATER 0)
563
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    30
562
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
    31
install(FILES
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
    32
	${BaseMusic}
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
    33
	DESTINATION ${SHAREPATH}Data/Music)