annotate src/core/CMakeLists.txt @ 116:0a6683615c73

cmake: change build system, continue #2487 @3h
author David Demelier <markand@malikania.fr>
date Sat, 03 Oct 2020 18:32:01 +0200
parents
children 3411daa26432
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 # CMakeLists.txt -- CMake build system for libcore
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 # Copyright (c) 2020 David Demelier <markand@malikania.fr>
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 project(libcore)
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 set(
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 SOURCES
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 ${libcore_SOURCE_DIR}/action.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 ${libcore_SOURCE_DIR}/animation.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 ${libcore_SOURCE_DIR}/animation.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 ${libcore_SOURCE_DIR}/button.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 ${libcore_SOURCE_DIR}/button.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 ${libcore_SOURCE_DIR}/checkbox.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 ${libcore_SOURCE_DIR}/checkbox.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 ${libcore_SOURCE_DIR}/clock.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 ${libcore_SOURCE_DIR}/clock.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 ${libcore_SOURCE_DIR}/color.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 ${libcore_SOURCE_DIR}/debug.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 ${libcore_SOURCE_DIR}/debug.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 ${libcore_SOURCE_DIR}/error.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 ${libcore_SOURCE_DIR}/error.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 ${libcore_SOURCE_DIR}/error_p.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 ${libcore_SOURCE_DIR}/event.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 ${libcore_SOURCE_DIR}/event.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 ${libcore_SOURCE_DIR}/font.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 ${libcore_SOURCE_DIR}/font.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 ${libcore_SOURCE_DIR}/frame.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 ${libcore_SOURCE_DIR}/frame.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 ${libcore_SOURCE_DIR}/game.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 ${libcore_SOURCE_DIR}/game.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 ${libcore_SOURCE_DIR}/image.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 ${libcore_SOURCE_DIR}/image.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 ${libcore_SOURCE_DIR}/inhibit.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 ${libcore_SOURCE_DIR}/inhibit.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 ${libcore_SOURCE_DIR}/inventory.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 ${libcore_SOURCE_DIR}/inventory.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 ${libcore_SOURCE_DIR}/inventory_dialog.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 ${libcore_SOURCE_DIR}/inventory_dialog.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 ${libcore_SOURCE_DIR}/item.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 ${libcore_SOURCE_DIR}/key.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 ${libcore_SOURCE_DIR}/label.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 ${libcore_SOURCE_DIR}/label.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 ${libcore_SOURCE_DIR}/map.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 ${libcore_SOURCE_DIR}/map.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
60 ${libcore_SOURCE_DIR}/map_state.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 ${libcore_SOURCE_DIR}/map_state.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 ${libcore_SOURCE_DIR}/maths.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
63 ${libcore_SOURCE_DIR}/maths.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
64 ${libcore_SOURCE_DIR}/message.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
65 ${libcore_SOURCE_DIR}/message.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
66 ${libcore_SOURCE_DIR}/mouse.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
67 ${libcore_SOURCE_DIR}/painter.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
68 ${libcore_SOURCE_DIR}/painter.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
69 ${libcore_SOURCE_DIR}/panic.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
70 ${libcore_SOURCE_DIR}/panic.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
71 ${libcore_SOURCE_DIR}/plat.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
72 ${libcore_SOURCE_DIR}/save.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
73 ${libcore_SOURCE_DIR}/save.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
74 ${libcore_SOURCE_DIR}/script.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
75 ${libcore_SOURCE_DIR}/script.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
76 ${libcore_SOURCE_DIR}/sound.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
77 ${libcore_SOURCE_DIR}/sound.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
78 ${libcore_SOURCE_DIR}/sprite.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
79 ${libcore_SOURCE_DIR}/sprite.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
80 ${libcore_SOURCE_DIR}/state.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
81 ${libcore_SOURCE_DIR}/sys.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
82 ${libcore_SOURCE_DIR}/sys.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
83 ${libcore_SOURCE_DIR}/texture.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
84 ${libcore_SOURCE_DIR}/texture.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
85 ${libcore_SOURCE_DIR}/texture_p.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
86 ${libcore_SOURCE_DIR}/theme.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
87 ${libcore_SOURCE_DIR}/theme.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
88 ${libcore_SOURCE_DIR}/util.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
89 ${libcore_SOURCE_DIR}/util.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
90 ${libcore_SOURCE_DIR}/wait.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
91 ${libcore_SOURCE_DIR}/wait.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
92 ${libcore_SOURCE_DIR}/walksprite.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
93 ${libcore_SOURCE_DIR}/walksprite.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
94 ${libcore_SOURCE_DIR}/window.c
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
95 ${libcore_SOURCE_DIR}/window.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
96 ${libcore_SOURCE_DIR}/window_p.h
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
97 )
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
98
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
99 add_library(libcore ${SOURCES})
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
100 target_link_libraries(
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
101 libcore
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
102 libassets
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
103 SDL2::SDL2
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
104 SDL2::image
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
105 SDL2::mixer
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
106 SDL2::ttf
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
107 )
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
108 target_compile_definitions(
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
109 libcore
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
110 PRIVATE
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
111 BINDIR="${CMAKE_INSTALL_BINDIR}"
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
112 PREFIX="${CMAKE_INSTALL_PREFIX}"
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
113 SHAREDIR="${CMAKE_INSTALL_DATADIR}"
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
114 PUBLIC
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
115 _XOPEN_SOURCE=700
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
116 )
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
117 target_include_directories(
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
118 libcore
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
119 PUBLIC
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
120 $<BUILD_INTERFACE:${libcore_SOURCE_DIR}>
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
121 )