562
|
1 |
file(GLOB BaseMusic *.ogg)
|
|
2 |
|
563
|
3 |
list(LENGTH BaseMusic PlayListLength)
|
|
4 |
|
782
|
5 |
set(PlayListINCFile ${CMAKE_BINARY_DIR}/hedgewars/playlist.inc)
|
563
|
6 |
|
|
7 |
file(WRITE ${PlayListINCFile} "const cPlayListLength = " ${PlayListLength} ";")
|
|
8 |
|
564
|
9 |
if(PlayListLength GREATER 0)
|
|
10 |
file(APPEND ${PlayListINCFile} "{$DEFINE HAVE_MUSIC}")
|
|
11 |
file(APPEND ${PlayListINCFile} "playlist: array[0..Pred(cPlayListLength)] of string = (")
|
563
|
12 |
|
564
|
13 |
set(i ${PlayListLength})
|
|
14 |
foreach(musicfile ${BaseMusic})
|
|
15 |
math(EXPR i "${i} - 1")
|
|
16 |
|
|
17 |
get_filename_component(relfilename ${musicfile} NAME)
|
|
18 |
|
|
19 |
file(APPEND ${PlayListINCFile} '${relfilename}')
|
|
20 |
|
|
21 |
if(i GREATER 0)
|
|
22 |
file(APPEND ${PlayListINCFile} ",")
|
|
23 |
endif(i GREATER 0)
|
|
24 |
endforeach(musicfile)
|
|
25 |
|
|
26 |
file(APPEND ${PlayListINCFile} ");")
|
|
27 |
|
|
28 |
file(APPEND ${PlayListINCFile} "var playlistchain: array[0..Pred(cPlayListLength)] of LongWord;")
|
|
29 |
endif(PlayListLength GREATER 0)
|
563
|
30 |
|
562
|
31 |
install(FILES
|
|
32 |
${BaseMusic}
|
|
33 |
DESTINATION ${SHAREPATH}Data/Music)
|