changeset 325:cd8b87ddd1e7

examples: bring back to live using CMake
author David Demelier <markand@malikania.fr>
date Sat, 02 Oct 2021 17:47:27 +0200
parents 87ad3de308b6
children 06782f7888f3
files .hgignore CMakeLists.txt examples/CMakeLists.txt examples/example-action/CMakeLists.txt examples/example-action/main.c examples/example-animation/CMakeLists.txt examples/example-animation/main.c examples/example-audio/CMakeLists.txt examples/example-audio/main.c examples/example-battle/CMakeLists.txt examples/example-cursor/CMakeLists.txt examples/example-debug/CMakeLists.txt examples/example-drawable/CMakeLists.txt examples/example-drawable/main.c examples/example-font/CMakeLists.txt examples/example-gridmenu/CMakeLists.txt examples/example-label/CMakeLists.txt examples/example-message/CMakeLists.txt examples/example-sprite/CMakeLists.txt examples/example-sprite/main.c examples/example-trace/CMakeLists.txt examples/example-ui/CMakeLists.txt
diffstat 22 files changed, 526 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sat Oct 02 08:33:39 2021 +0200
+++ b/.hgignore	Sat Oct 02 17:47:27 2021 +0200
@@ -14,5 +14,7 @@
 
 # Generated files.
 \.exe$
+^mlk-
+^example-
 ^src/libmlk-data/maps/.*\.map$
 ^src/libmlk-data/maps/.*\.tileset$
--- a/CMakeLists.txt	Sat Oct 02 08:33:39 2021 +0200
+++ b/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -38,7 +38,8 @@
 
 option(MLK_WITH_NLS "Enable NLS support" On)
 option(MLK_WITH_ZSTD "Enable zstd compression" On)
-option(MLK_WITH_TESTS "Enable unit tests" On)
+option(MLK_WITH_TESTS "Enable unit tests" Off)
+option(MLK_WITH_EXAMPLES "Enable examples" Off)
 
 include(cmake/MlkBcc.cmake)
 include(cmake/MlkExecutable.cmake)
@@ -86,3 +87,7 @@
 	enable_testing()
 	add_subdirectory(tests)
 endif ()
+
+if (MLK_WITH_EXAMPLES)
+	add_subdirectory(examples)
+endif ()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,41 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(examples)
+
+set(
+	DIRS
+	example-action
+	example-animation
+	example-audio
+#	example-battle
+	example-cursor
+	example-debug
+	example-drawable
+	example-font
+	example-gridmenu
+	example-label
+	example-message
+	example-sprite
+	example-trace
+	example-ui
+)
+
+foreach (d ${DIRS})
+	add_subdirectory(${d})
+endforeach ()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-action/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-action)
+
+set(
+	SOURCES
+	${example-action_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-action
+	FOLDER examples
+	LIBRARIES libmlk-rpg
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- a/examples/example-action/main.c	Sat Oct 02 08:33:39 2021 +0200
+++ b/examples/example-action/main.c	Sat Oct 02 17:47:27 2021 +0200
@@ -42,7 +42,7 @@
 
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/mlk-adventure/%s", sys_dir(SYS_DIR_DATA), r)
+#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 
 #define MW      (W * 0.75)
 #define MX      ((W / 2) - (MW / 2))
@@ -314,7 +314,7 @@
 static void
 init(void)
 {
-	if (core_init("fr.malikania", "actions") < 0 || ui_init() < 0 || rpg_init() < 0)
+	if (core_init("fr.malikania", "mlk-adventure") < 0 || ui_init() < 0 || rpg_init() < 0)
 		panic();
 	if (window_open("Example - Action", W, H) < 0)
 		panic();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-animation/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-animation)
+
+set(
+	SOURCES
+	${example-animation_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-animation
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- a/examples/example-animation/main.c	Sat Oct 02 08:33:39 2021 +0200
+++ b/examples/example-animation/main.c	Sat Oct 02 17:47:27 2021 +0200
@@ -35,7 +35,7 @@
 
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/mlk-adventure/%s", sys_dir(SYS_DIR_DATA), r)
+#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 
 static struct label label = {
 	.text = "Keys: <Space> start or reset the animation.",
@@ -52,7 +52,7 @@
 static void
 init(void)
 {
-	if (core_init("fr.malikania", "animation") < 0 || ui_init() < 0)
+	if (core_init("fr.malikania", "mlk-adventure") < 0 || ui_init() < 0)
 		panic();
 	if (window_open("Example - Animation", W, H) < 0)
 		panic();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-audio/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-audio)
+
+set(
+	SOURCES
+	${example-audio_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-audio
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- a/examples/example-audio/main.c	Sat Oct 02 08:33:39 2021 +0200
+++ b/examples/example-audio/main.c	Sat Oct 02 17:47:27 2021 +0200
@@ -34,7 +34,7 @@
 
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/mlk-adventure/%s", sys_dir(SYS_DIR_DATA), r)
+#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 
 static struct music music;
 static struct sound sound;
@@ -56,7 +56,7 @@
 static void
 init(void)
 {
-	if (core_init("fr.malikania", "audio") < 0 || ui_init() < 0)
+	if (core_init("fr.malikania", "mlk-adventure") < 0 || ui_init() < 0)
 		panic();
 	if (window_open("Example - Audio", W, H) < 0)
 		panic();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-battle/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,39 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-battle)
+
+set(
+	SOURCES
+	${example-battle_SOURCE_DIR}/character-john.c
+	${example-battle_SOURCE_DIR}/character-john.h
+	${example-battle_SOURCE_DIR}/main.c
+	${example-battle_SOURCE_DIR}/registry.c
+	${example-battle_SOURCE_DIR}/registry.h
+	${example-battle_SOURCE_DIR}/spell-fire.c
+	${example-battle_SOURCE_DIR}/spell-fire.h
+)
+
+mlk_executable(
+	NAME example-battle
+	FOLDER examples
+	LIBRARIES libmlk-rpg
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-cursor/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-cursor)
+
+set(
+	SOURCES
+	${example-cursor_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-cursor
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-debug/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-debug)
+
+set(
+	SOURCES
+	${example-debug_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-debug
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-drawable/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-drawable)
+
+set(
+	SOURCES
+	${example-drawable_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-drawable
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- a/examples/example-drawable/main.c	Sat Oct 02 08:33:39 2021 +0200
+++ b/examples/example-drawable/main.c	Sat Oct 02 17:47:27 2021 +0200
@@ -42,7 +42,7 @@
 
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/mlk-adventure/%s", sys_dir(SYS_DIR_DATA), r)
+#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 
 static struct label help = {
 	.x = 10,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-font/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-font)
+
+set(
+	SOURCES
+	${example-font_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-font
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-gridmenu/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-gridmenu)
+
+set(
+	SOURCES
+	${example-gridmenu_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-gridmenu
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-label/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-label)
+
+set(
+	SOURCES
+	${example-label_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-label
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-message/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-message)
+
+set(
+	SOURCES
+	${example-message_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-message
+	FOLDER examples
+	LIBRARIES libmlk-rpg
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-sprite/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-sprite)
+
+set(
+	SOURCES
+	${example-sprite_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-sprite
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- a/examples/example-sprite/main.c	Sat Oct 02 08:33:39 2021 +0200
+++ b/examples/example-sprite/main.c	Sat Oct 02 17:47:27 2021 +0200
@@ -39,7 +39,7 @@
 
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/mlk-adventure/%s", sys_dir(SYS_DIR_DATA), r)
+#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 #define HEADER "Keys: <Left>/<Right> and <Up/Down> to select a column/row. Current: %u, %u (total %u/%u)"
 
 static char msg[512];
@@ -63,7 +63,7 @@
 static void
 init(void)
 {
-	if (core_init("fr.malikania", "sprite") < 0 || ui_init() < 0)
+	if (core_init("fr.malikania", "mlk-adventure") < 0 || ui_init() < 0)
 		panic();
 	if (window_open("Example - Sprite", W, H) < 0)
 		panic();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-trace/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-trace)
+
+set(
+	SOURCES
+	${example-trace_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-trace
+	FOLDER examples
+	LIBRARIES libmlk-adventure
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/example-ui/CMakeLists.txt	Sat Oct 02 17:47:27 2021 +0200
@@ -0,0 +1,33 @@
+#
+# CMakeLists.txt -- CMake build system for Molko's Adventure
+#
+# Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+project(example-ui)
+
+set(
+	SOURCES
+	${example-ui_SOURCE_DIR}/main.c
+)
+
+mlk_executable(
+	NAME example-ui
+	FOLDER examples
+	LIBRARIES libmlk-ui
+	SOURCES ${SOURCES}
+)
+
+source_group("" FILES ${SOURCES})