annotate libmlk-core/CMakeLists.txt @ 281:87b8c7510717

rpg: implement load/save for characters
author David Demelier <markand@malikania.fr>
date Sun, 20 Dec 2020 10:55:53 +0100
parents 9bbbabb6f077
children b5139fcb0832
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 #
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
2 # CMakeLists.txt -- CMake build system for libmlk-core
116
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
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
19 project(libmlk-core)
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
194
10a7df431d00 misc: portability fixes
David Demelier <markand@malikania.fr>
parents: 182
diff changeset
21 include(CheckLibraryExists)
10a7df431d00 misc: portability fixes
David Demelier <markand@malikania.fr>
parents: 182
diff changeset
22
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 set(
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
24 PO
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
25 ${libmlk-core_SOURCE_DIR}/nls/fr.po
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
26 )
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
27
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
28 set(
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 SOURCES
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
30 ${libmlk-core_SOURCE_DIR}/core/action.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
31 ${libmlk-core_SOURCE_DIR}/core/action.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
32 ${libmlk-core_SOURCE_DIR}/core/alloc.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
33 ${libmlk-core_SOURCE_DIR}/core/alloc.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
34 ${libmlk-core_SOURCE_DIR}/core/animation.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
35 ${libmlk-core_SOURCE_DIR}/core/animation.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
36 ${libmlk-core_SOURCE_DIR}/core/clock.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
37 ${libmlk-core_SOURCE_DIR}/core/clock.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
38 ${libmlk-core_SOURCE_DIR}/core/color.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
39 ${libmlk-core_SOURCE_DIR}/core/core.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
40 ${libmlk-core_SOURCE_DIR}/core/core.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
41 ${libmlk-core_SOURCE_DIR}/core/core_p.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
42 ${libmlk-core_SOURCE_DIR}/core/drawable.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
43 ${libmlk-core_SOURCE_DIR}/core/drawable.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
44 ${libmlk-core_SOURCE_DIR}/core/error.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
45 ${libmlk-core_SOURCE_DIR}/core/error.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
46 ${libmlk-core_SOURCE_DIR}/core/event.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
47 ${libmlk-core_SOURCE_DIR}/core/event.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
48 ${libmlk-core_SOURCE_DIR}/core/font.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
49 ${libmlk-core_SOURCE_DIR}/core/font.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
50 ${libmlk-core_SOURCE_DIR}/core/game.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
51 ${libmlk-core_SOURCE_DIR}/core/game.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
52 ${libmlk-core_SOURCE_DIR}/core/image.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
53 ${libmlk-core_SOURCE_DIR}/core/image.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
54 ${libmlk-core_SOURCE_DIR}/core/inhibit.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
55 ${libmlk-core_SOURCE_DIR}/core/key.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
56 ${libmlk-core_SOURCE_DIR}/core/maths.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
57 ${libmlk-core_SOURCE_DIR}/core/maths.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
58 ${libmlk-core_SOURCE_DIR}/core/mouse.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
59 ${libmlk-core_SOURCE_DIR}/core/music.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
60 ${libmlk-core_SOURCE_DIR}/core/music.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
61 ${libmlk-core_SOURCE_DIR}/core/painter.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
62 ${libmlk-core_SOURCE_DIR}/core/painter.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
63 ${libmlk-core_SOURCE_DIR}/core/panic.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
64 ${libmlk-core_SOURCE_DIR}/core/panic.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
65 ${libmlk-core_SOURCE_DIR}/core/script.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
66 ${libmlk-core_SOURCE_DIR}/core/script.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
67 ${libmlk-core_SOURCE_DIR}/core/sound.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
68 ${libmlk-core_SOURCE_DIR}/core/sound.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
69 ${libmlk-core_SOURCE_DIR}/core/sprite.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
70 ${libmlk-core_SOURCE_DIR}/core/sprite.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
71 ${libmlk-core_SOURCE_DIR}/core/state.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
72 ${libmlk-core_SOURCE_DIR}/core/state.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
73 ${libmlk-core_SOURCE_DIR}/core/sys.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
74 ${libmlk-core_SOURCE_DIR}/core/sys.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
75 ${libmlk-core_SOURCE_DIR}/core/sysconfig.h.in
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
76 ${libmlk-core_SOURCE_DIR}/core/texture.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
77 ${libmlk-core_SOURCE_DIR}/core/texture.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
78 ${libmlk-core_SOURCE_DIR}/core/texture_p.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
79 ${libmlk-core_SOURCE_DIR}/core/trace.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
80 ${libmlk-core_SOURCE_DIR}/core/trace.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
81 ${libmlk-core_SOURCE_DIR}/core/translate.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
82 ${libmlk-core_SOURCE_DIR}/core/translate.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
83 ${libmlk-core_SOURCE_DIR}/core/util.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
84 ${libmlk-core_SOURCE_DIR}/core/util.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
85 ${libmlk-core_SOURCE_DIR}/core/window.c
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
86 ${libmlk-core_SOURCE_DIR}/core/window.h
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
87 ${libmlk-core_SOURCE_DIR}/core/window_p.h
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
88 )
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
89
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
90 configure_file(
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
91 ${libmlk-core_SOURCE_DIR}/core/sysconfig.h.in
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
92 ${libmlk-core_BINARY_DIR}/sysconfig.h
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
93 )
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
94
194
10a7df431d00 misc: portability fixes
David Demelier <markand@malikania.fr>
parents: 182
diff changeset
95 check_library_exists(m sqrt "" LIBM)
10a7df431d00 misc: portability fixes
David Demelier <markand@malikania.fr>
parents: 182
diff changeset
96
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
97 if (MOLKO_WITH_NLS AND Intl_FOUND)
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
98 list(APPEND LIBS ${Intl_LIBRARIES})
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
99 list(APPEND INCS ${Intl_INCLUDE_DIRS})
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
100 endif ()
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
101
118
3411daa26432 cmake: create macros for building assets, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 116
diff changeset
102 molko_define_library(
242
4c24604efcab cmake: create build hierarchy similar to install, closes #2518 @1h
David Demelier <markand@malikania.fr>
parents: 241
diff changeset
103 TARGET libmlk-core
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
104 SOURCES ${SOURCES} ${ASSETS} ${PO}
241
76afe639fd72 misc: add support for NLS, closes #22510 @4h
David Demelier <markand@malikania.fr>
parents: 226
diff changeset
105 TRANSLATIONS fr
118
3411daa26432 cmake: create macros for building assets, continue #2487 @1h
David Demelier <markand@malikania.fr>
parents: 116
diff changeset
106 LIBRARIES
264
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
107 PUBLIC
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
108 ${LIBS}
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
109 $<$<BOOL:${LIBM}>:m>
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
110 libcompat
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
111 libsqlite
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
112 SDL2::SDL2
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
113 SDL2::image
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
114 SDL2::mixer
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
115 SDL2::ttf
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
116 FLAGS
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
117 PRIVATE
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
118 _BSD_SOURCE
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
119 BINDIR="${CMAKE_INSTALL_BINDIR}"
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
120 PREFIX="${CMAKE_INSTALL_PREFIX}"
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
121 SHAREDIR="${CMAKE_INSTALL_DATADIR}"
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
122 INCLUDES
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
123 PUBLIC
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
124 ${INCS}
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
125 $<BUILD_INTERFACE:${libmlk-core_SOURCE_DIR}>
9bbbabb6f077 cmake: make macros simpler
David Demelier <markand@malikania.fr>
parents: 258
diff changeset
126 $<BUILD_INTERFACE:${libmlk-core_BINARY_DIR}>
116
0a6683615c73 cmake: change build system, continue #2487 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
127 )
121
789b23e01f52 misc: reorganize hierarchy, closes #2490
David Demelier <markand@malikania.fr>
parents: 120
diff changeset
128
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
129 source_group(TREE ${libmlk-core_SOURCE_DIR} FILES ${SOURCES})
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
130 source_group(TREE ${libmlk-core_SOURCE_DIR} FILES ${ASSETS})
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 242
diff changeset
131 source_group(TREE ${libmlk-core_SOURCE_DIR} FILES ${PO})