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
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
file(APPEND ${PlayListINCFile} "playlist = array[0..Pred(cPlayListLength)] of string = (")
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
     9
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    10
set(i ${PlayListLength})
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    11
foreach(musicfile ${BaseMusic})
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    12
	math(EXPR i "${i} - 1")
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    13
	
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    14
	get_filename_component(relfilename ${musicfile} NAME)
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    15
	
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    16
	file(APPEND ${PlayListINCFile} '${relfilename}')
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    17
	
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    18
	if(i GREATER 0)
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    19
		file(APPEND ${PlayListINCFile} ",")
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    20
	endif(i GREATER 0)
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    21
endforeach(musicfile)
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    22
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    23
file(APPEND ${PlayListINCFile} ");")
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    24
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    25
file(APPEND ${PlayListINCFile} "var playlistchain = array[0..Pred(cPlayListLength)] of LongWord;")
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    26
5131c641073f Initial playlists support
unc0rr
parents: 562
diff changeset
    27
562
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
    28
install(FILES
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
    29
	${BaseMusic}
d1a9035175ed - Simplify build system files
unc0rr
parents:
diff changeset
    30
	DESTINATION ${SHAREPATH}Data/Music)