-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (57 loc) · 1.79 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 2.6)
project(ZROS)
set(quest_name "zros")
# data files list
file(GLOB_RECURSE data_files
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/data
${CMAKE_CURRENT_SOURCE_DIR}/data/*.spc
${CMAKE_CURRENT_SOURCE_DIR}/data/*.ogg
${CMAKE_CURRENT_SOURCE_DIR}/data/*.it
${CMAKE_CURRENT_SOURCE_DIR}/data/*.png
${CMAKE_CURRENT_SOURCE_DIR}/data/*.dat
${CMAKE_CURRENT_SOURCE_DIR}/data/*.lua
${CMAKE_CURRENT_SOURCE_DIR}/data/*.ttf
${CMAKE_CURRENT_SOURCE_DIR}/data/*.ttc
${CMAKE_CURRENT_SOURCE_DIR}/data/*.fon
)
file(GLOB_RECURSE data_files_prefixed
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/data/*.spc
${CMAKE_CURRENT_SOURCE_DIR}/data/*.ogg
${CMAKE_CURRENT_SOURCE_DIR}/data/*.it
${CMAKE_CURRENT_SOURCE_DIR}/data/*.png
${CMAKE_CURRENT_SOURCE_DIR}/data/*.dat
${CMAKE_CURRENT_SOURCE_DIR}/data/*.lua
${CMAKE_CURRENT_SOURCE_DIR}/data/*.ttf
${CMAKE_CURRENT_SOURCE_DIR}/data/*.ttc
${CMAKE_CURRENT_SOURCE_DIR}/data/*.fon
)
# add other data to zip archive
add_custom_command(
OUTPUT data.solarus
DEPENDS ${data_files_prefixed}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data
COMMAND zip -q ${CMAKE_CURRENT_BINARY_DIR}/data.solarus ${data_files}
)
add_custom_target(${quest_name}_data
ALL
DEPENDS data.solarus
)
# create a script that executes the engine with this quest
add_custom_command(
OUTPUT ${quest_name}
COMMAND echo '\#!/bin/bash' > ${quest_name}
COMMAND echo 'solarus ${CMAKE_INSTALL_PREFIX}/share/solarus/${quest_name} $*' >> ${quest_name}
)
add_custom_target(${quest_name}_command
ALL
DEPENDS ${quest_name}
)
# install the data archive
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/data.solarus
DESTINATION share/solarus/${quest_name}
)
# install the script
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${quest_name}
DESTINATION bin
)