-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (84 loc) · 2.12 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 3.0)
project(Map2D)
# SDL2 search components
INCLUDE(FindPkgConfig)
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0)
PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer>=2.0.0)
PKG_SEARCH_MODULE(SDL2TTF REQUIRED SDL2_ttf>=2.0.0)
# copy resources (not in a smart way)
file(COPY ${CMAKE_SOURCE_DIR}/bakhar.opt DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/buttons DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/biomes.xml DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/craft.xml DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/FreePixel.ttf DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/generator DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/images DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/items DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/language DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/none.png DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/objects DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/pixel11.ttf DESTINATION ${CMAKE_BINARY_DIR})
# list all sources:
set(Map2D_sources
action.cpp
archive.cpp
button.cpp
camera.cpp
character.cpp
craft_mgr.cpp
dialog.cpp
font.cpp
items.cpp
job.cpp
logger.cpp
main.cpp
map.cpp
object.cpp
path_finding.cpp
perlin_noise.cpp
sdl_background.cpp
sdl_button.cpp
sdl_camera.cpp
sdl_tool.cpp
session.cpp
tests.cpp
texture_mgr.cpp
translator.cpp
xml_document.cpp
)
# list headers
set(Map2D_headers
action.h
archive.h
button.h
camera.h
character.h
craft_mgr.h
dialog.h
font.h
items.h
job.h
logger.h
map.h
object.h
path_finding.h
perlin_noise.h
sdl_background.h
sdl_button.h
sdl_camera.h
sdl_tool.h
session.h
tests.h
texture_mgr.h
translator.h
utility.h
xml_document.h
)
add_executable(Map2D ${Map2D_headers} ${Map2D_sources})
target_link_libraries(Map2D
${SDL2_LIBRARIES}
${SDL2IMAGE_LIBRARIES}
${SDL2MIXER_LIBRARIES}
${SDL2TTF_LIBRARIES}
)