annotate libmlk-core/CMakeLists.txt @ 578:f271681ce015

mlk-map: follow conventions
author David Demelier <markand@malikania.fr>
date Sat, 11 Mar 2023 11:20:46 +0100
parents f45a023f6690
children cedfdbc0e9a7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
447
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 # CMakeLists.txt -- CMake build system for Molko's Engine
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 # Copyright (c) 2020-2022 David Demelier <markand@malikania.fr>
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 project(libmlk-core)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 set(
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 SOURCES
466
39dd7c66ebfd core: script -> mlk_action_script
David Demelier <markand@malikania.fr>
parents: 450
diff changeset
23 ${libmlk-core_SOURCE_DIR}/mlk/core/action-script.c
39dd7c66ebfd core: script -> mlk_action_script
David Demelier <markand@malikania.fr>
parents: 450
diff changeset
24 ${libmlk-core_SOURCE_DIR}/mlk/core/action-script.h
450
b26dd49f69ff core: event -> mlk_event (and friends)
David Demelier <markand@malikania.fr>
parents: 447
diff changeset
25 ${libmlk-core_SOURCE_DIR}/mlk/core/action-stack.c
b26dd49f69ff core: event -> mlk_event (and friends)
David Demelier <markand@malikania.fr>
parents: 447
diff changeset
26 ${libmlk-core_SOURCE_DIR}/mlk/core/action-stack.h
447
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 ${libmlk-core_SOURCE_DIR}/mlk/core/action.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 ${libmlk-core_SOURCE_DIR}/mlk/core/action.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 ${libmlk-core_SOURCE_DIR}/mlk/core/alloc.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 ${libmlk-core_SOURCE_DIR}/mlk/core/alloc.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 ${libmlk-core_SOURCE_DIR}/mlk/core/animation.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 ${libmlk-core_SOURCE_DIR}/mlk/core/animation.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 ${libmlk-core_SOURCE_DIR}/mlk/core/clock.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 ${libmlk-core_SOURCE_DIR}/mlk/core/clock.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 ${libmlk-core_SOURCE_DIR}/mlk/core/color.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 ${libmlk-core_SOURCE_DIR}/mlk/core/core.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 ${libmlk-core_SOURCE_DIR}/mlk/core/core.h
450
b26dd49f69ff core: event -> mlk_event (and friends)
David Demelier <markand@malikania.fr>
parents: 447
diff changeset
38 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable-stack.c
b26dd49f69ff core: event -> mlk_event (and friends)
David Demelier <markand@malikania.fr>
parents: 447
diff changeset
39 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable-stack.h
447
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable.h
450
b26dd49f69ff core: event -> mlk_event (and friends)
David Demelier <markand@malikania.fr>
parents: 447
diff changeset
42 ${libmlk-core_SOURCE_DIR}/mlk/core/err.c
b26dd49f69ff core: event -> mlk_event (and friends)
David Demelier <markand@malikania.fr>
parents: 447
diff changeset
43 ${libmlk-core_SOURCE_DIR}/mlk/core/err.h
447
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 ${libmlk-core_SOURCE_DIR}/mlk/core/event.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 ${libmlk-core_SOURCE_DIR}/mlk/core/event.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 ${libmlk-core_SOURCE_DIR}/mlk/core/font.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 ${libmlk-core_SOURCE_DIR}/mlk/core/font.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 ${libmlk-core_SOURCE_DIR}/mlk/core/game.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 ${libmlk-core_SOURCE_DIR}/mlk/core/game.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 ${libmlk-core_SOURCE_DIR}/mlk/core/image.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 ${libmlk-core_SOURCE_DIR}/mlk/core/image.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 ${libmlk-core_SOURCE_DIR}/mlk/core/key.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 ${libmlk-core_SOURCE_DIR}/mlk/core/maths.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 ${libmlk-core_SOURCE_DIR}/mlk/core/maths.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 ${libmlk-core_SOURCE_DIR}/mlk/core/mouse.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 ${libmlk-core_SOURCE_DIR}/mlk/core/music.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 ${libmlk-core_SOURCE_DIR}/mlk/core/music.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 ${libmlk-core_SOURCE_DIR}/mlk/core/painter.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 ${libmlk-core_SOURCE_DIR}/mlk/core/painter.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
60 ${libmlk-core_SOURCE_DIR}/mlk/core/panic.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 ${libmlk-core_SOURCE_DIR}/mlk/core/panic.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 ${libmlk-core_SOURCE_DIR}/mlk/core/sound.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
63 ${libmlk-core_SOURCE_DIR}/mlk/core/sound.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
64 ${libmlk-core_SOURCE_DIR}/mlk/core/sprite.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
65 ${libmlk-core_SOURCE_DIR}/mlk/core/sprite.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
66 ${libmlk-core_SOURCE_DIR}/mlk/core/state.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
67 ${libmlk-core_SOURCE_DIR}/mlk/core/state.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
68 ${libmlk-core_SOURCE_DIR}/mlk/core/sys.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
69 ${libmlk-core_SOURCE_DIR}/mlk/core/sys.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
70 ${libmlk-core_SOURCE_DIR}/mlk/core/sys_p.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
71 ${libmlk-core_SOURCE_DIR}/mlk/core/texture.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
72 ${libmlk-core_SOURCE_DIR}/mlk/core/texture.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
73 ${libmlk-core_SOURCE_DIR}/mlk/core/texture_p.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
74 ${libmlk-core_SOURCE_DIR}/mlk/core/trace.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
75 ${libmlk-core_SOURCE_DIR}/mlk/core/trace.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
76 ${libmlk-core_SOURCE_DIR}/mlk/core/util.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
77 ${libmlk-core_SOURCE_DIR}/mlk/core/util.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
78 ${libmlk-core_SOURCE_DIR}/mlk/core/window.c
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
79 ${libmlk-core_SOURCE_DIR}/mlk/core/window.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
80 ${libmlk-core_SOURCE_DIR}/mlk/core/window_p.h
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
81 )
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
82
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
83 set(
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
84 NLS
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
85 ${libmlk-core_SOURCE_DIR}/nls/fr.po
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
86 )
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
87
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
88 if (MLK_WITH_NLS)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
89 list(APPEND LIBRARIES ${Intl_LIBRARIES})
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
90 endif ()
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
91
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
92 if (MLK_WITH_ZSTD)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
93 list(APPEND LIBRARIES ZSTD::ZSTD)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
94 endif ()
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
95
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
96 if (MLK_WITH_ZIP)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
97 list(APPEND LIBRARIES Libzip::Libzip)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
98 endif ()
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
99
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
100 if (CMAKE_SYSTEM_NAME MATCHES "Windows")
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
101 list(APPEND LIBRARIES shlwapi)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
102 endif ()
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
103
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
104 if (M_LIBRARY)
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
105 list(APPEND LIBRARIES ${M_LIBRARY})
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
106 endif ()
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
107
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
108 mlk_library(
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
109 NAME libmlk-core
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
110 SOURCES ${SOURCES} ${NLS}
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
111 LANGS ${NLS}
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
112 LIBRARIES
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
113 PUBLIC
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
114 ${LIBRARIES}
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
115 ${OPENAL_LIBRARY}
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
116 SndFile::SndFile
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
117 SDL2::SDL2
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
118 SDL2::image
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
119 SDL2::ttf
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
120 libmlk-util
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
121 INCLUDES
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
122 PUBLIC
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
123 ${OPENAL_INCLUDE_DIR}
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
124 $<BUILD_INTERFACE:${libmlk-core_SOURCE_DIR}>
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
125 )
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
126
e1fa1b867281 cmake: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
127 source_group(TREE ${libmlk-core_SOURCE_DIR} FILES ${SOURCES} ${NLS})