changeset 245:97f55f6b9593

doc: add CMake macros documentation
author David Demelier <markand@malikania.fr>
date Mon, 30 Nov 2020 10:54:59 +0100
parents 498da86d1cd7
children a8512094169e
files cmake/MolkoBuildAssets.cmake cmake/MolkoBuildMaps.cmake cmake/MolkoBuildTilesets.cmake cmake/MolkoBuildTranslations.cmake cmake/MolkoDefineExecutable.cmake cmake/MolkoDefineLibrary.cmake cmake/MolkoDefineTest.cmake cmake/MolkoSetBuildDirectories.cmake cmake/MolkoSetCompilerFlags.cmake doc/CMakeLists.txt doc/cmake-extract.sh doc/docs/dev/error.md doc/docs/dev/faq.md doc/docs/dev/ownership.md doc/mkdocs.yml
diffstat 15 files changed, 259 insertions(+), 131 deletions(-) [+]
line wrap: on
line diff
--- a/cmake/MolkoBuildAssets.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoBuildAssets.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,24 +17,27 @@
 #
 
 #
-# molko_build_assets
-# ------------------
-#
-# Synopsis:
-#
-# molko_build_assets(assets outputs)
+# # molko_build_assets
 #
 # Generate custom commands to convert assets into C header files using mlk-bcc.
 # The argument output will be set to contain every generated output so that the
 # caller can set them as source input and be generated before the target itself.
 #
-# Example:
+# ## Synopsis:
 #
+# ```cmake
+# molko_build_assets(assets outputs)
+# ```
+#
+# ## Example
+#
+# ```cmake
 # molko_build_assets(image.png outputs)
 # add_executable(main main.c ${outputs})
+# ```
 #
 # Do not forget to add the CMake current binary directory
-# ${CMAKE_CURRENT_BINARY_DIR} through the include flags of the given target.
+# `${CMAKE_CURRENT_BINARY_DIR}` through the include flags of the given target.
 #
 # Each file is generated using the exact same file hierarchy as the input so
 # an input of foo/bar/baz.png will be generated as foo/bar/baz.h in the binary
--- a/cmake/MolkoBuildMaps.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoBuildMaps.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,20 +17,21 @@
 #
 
 #
-# molko_build_maps
-# ----------------
-#
-# Synopsis:
-#
-# molko_build_maps(input outputs)
+# # molko_build_maps
 #
 # Generate .map files from tiled .json files using the mlk-map tool. The file
 # hierarchy is kept and only extension is changed from .json to .map.
 #
+# ## Synopsis
+#
+# ```cmake
+# molko_build_maps(input outputs)
+# ```
+#
 # Argument outputs will be set with the generated output files in the binary
 # directory to be added as target sources.
 #
-# Make sure to add ${CMAKE_CURRENT_BINARY_DIR} into the target include
+# Make sure to add `${CMAKE_CURRENT_BINARY_DIR}` into the target include
 # directories.
 #
 
--- a/cmake/MolkoBuildTilesets.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoBuildTilesets.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,20 +17,22 @@
 #
 
 #
-# molko_build_tilesets
-# --------------------
+# # molko_build_tilesets
 #
-# Synopsis:
+# Generate .tileset files from tiled .json files using the mlk-tileset tool.
+# The file hierarchy is kept and only extension is changed from .json to
+# .tileset.
 #
-# molko_build_tilesets(input outputs)
+# ## Synopsis
 #
-# Generate .tileset files from tiled .json files using the mlk-tileset tool. The
-# file hierarchy is kept and only extension is changed from .json to .tileset.
+# ```cmake
+# molko_build_tilesets(input outputs)
+# ```
 #
 # Argument outputs will be set with the generated output files in the binary
 # directory to be added as target sources.
 #
-# Make sure to add ${CMAKE_CURRENT_BINARY_DIR} into the target include
+# Make sure to add `${CMAKE_CURRENT_BINARY_DIR}` into the target include
 # directories.
 #
 
--- a/cmake/MolkoBuildTranslations.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoBuildTranslations.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,36 +17,39 @@
 #
 
 #
-# molko_build_translations
-# ------------------------
+# # molko_build_translations
+#
+# Build translations and update them.
 #
-# Synopsis:
+# ## Synopsis
 #
+# ```cmake
 # molko_build_translations(
 #   TARGET              target name
 #   SOURCES             target sources
 #   OUTPUTS             output variable
 #   TRANSLATIONS        list of localizations
 # )
+# ```
 #
 # Generate target and output commands for NLS (via GNU gettext) support for the
-# given TARGET name.
+# given *TARGET* name.
 #
-# The argument SOURCES must contain sources to extract gettext keywords, it will
-# search for _, N_. The list of SOURCES can contain any files, only .c and .h
-# will be filtered.
+# The argument *SOURCES* must contain sources to extract gettext keywords, it
+# will search for _, N_. The list of *SOURCES* can contain any files, only .c
+# and .h will be filtered.
 #
-# The argument OUTPUTS will be set with the generated .mo files in the binary
-# directory and installed to CMAKE_INSTALL_LOCALEDIR.
+# The argument *OUTPUTS* will be set with the generated .mo files in the binary
+# directory and installed to *CMAKE_INSTALL_LOCALEDIR*.
 #
-# The argument TRANSLATIONS should contain a list of languages supported in the
+# The argument *TRANSLATIONS* should contain a list of languages supported in the
 # gettext form (ll_LL@variant, see ISO 639 and ISO 3166 for more details).
 #
-# This macro create a <TARGET>-po target that will recreate the .pot file and
+# This macro create a `<TARGET>-po` target that will recreate the .pot file and
 # every .po files in the nls/ directory for each language specified in
-# TRANSLATIONS. Note, if you add a new language into translations but do not
-# copy the .pot file, a warning will be issued and you should copy the .pot file
-# as the new .po language file.
+# *TRANSLATIONS*. Note, if you add a new language into translations but do not
+# copy the .pot file, a warning will be issued and you should copy the .pot
+# file as the new .po language file.
 #
 # Since the target is modifying files directly in the source tree they are not
 # included in any build process and must be invoked manually.
--- a/cmake/MolkoDefineExecutable.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoDefineExecutable.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,11 +17,13 @@
 #
 
 #
-# molko_define_executable
-# -----------------------
+# # molko_define_executable
+#
+# Create an executable.
 #
-# Synopsis:
+# ## Synopsis
 #
+# ```cmake
 # molko_define_test(
 #   TARGET              target name
 #   SOURCES             src1, src2, srcn
@@ -31,15 +33,18 @@
 #   FLAGS               (Optional) C flags (without -D)
 #   LIBRARIES           (Optional) libraries to link
 #   INCLUDES            (Optional) includes
+# )
+# ```
 #
-# Create an executable with the name TARGET with the given SOURCES.
+# Create an executable with the name *TARGET* with the given *SOURCES*.
 #
-# Optional include paths, libraries and flags can be specified via INCLUDES,
-# LIBRARIES and FLAGS arguments respectively.
+# Optional include paths, libraries and flags can be specified via *INCLUDES*,
+# *LIBRARIES* and *FLAGS* arguments respectively.
 #
-# If argument ASSETS is set, they are generated in the target binary directory.
+# If argument *ASSETS* is set, they are generated in the target binary
+# directory.
 #
-# The optional argument TRANSLATIONS should contain a list of supported
+# The optional argument *TRANSLATIONS* should contain a list of supported
 # translations. See molko_build_translations for more info.
 #
 
--- a/cmake/MolkoDefineLibrary.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoDefineLibrary.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,11 +17,13 @@
 #
 
 #
-# molko_define_library
-# --------------------
+# # molko_define_library
+#
+# Create any kind of library.
 #
-# Synopsis:
+# ## Synopsis
 #
+# ```cmake
 # molko_define_library(
 #   TARGET              target name
 #   SOURCES             src1, src2, srcn
@@ -35,27 +37,29 @@
 #   PUBLIC_FLAGS        (Optional) C flags (without -D)
 #   PUBLIC_INCLUDES     (Optional) includes to share with target dependencies
 # )
+# ```
 #
 # Create a library and optionally install it.
 #
-# The function create a new library named with the parameter TARGET, you should
-# prefix it with "lib" as its the convention within molko (e.g. libfoo), the
-# prefix is automatically removed.
+# The function create a new library named with the parameter *TARGET*, you
+# should prefix it with "lib" as its the convention within molko (e.g. libfoo),
+# the prefix is automatically removed.
 #
-# The argument SOURCES should contains the C source files and HEADERS should
-# points to a directory to be installed verbatim in the include directory.
+# The argument *SOURCES* should contains the C source files and *HEADERS*
+# should points to a directory to be installed verbatim in the include
+# directory.
 #
-# Optional argument EXTERNAL should be set for targets that are not maintained
-# here (e.g. third party libraries embedded).
+# Optional argument *EXTERNAL* should be set for targets that are not
+# maintained here (e.g. third party libraries embedded).
 #
-# Optional argument PRIVATE_FLAGS, PUBLIC_FLAGS, PRIVATE_INCLUDES,
-# PUBLIC_INCLUDES, LIBRARIES may be passed to set compile flags, includes and
-# libraries respectively.
+# Optional argument *PRIVATE_FLAGS*, *PUBLIC_FLAGS*, *PRIVATE_INCLUDES*,
+# *PUBLIC_INCLUDES*, *LIBRARIES* may be passed to set compile flags, includes
+# and libraries respectively.
 #
-# The arguments ASSETS contains a list of assets to be converted during the
-# build. The file hierarchy is conserved in the ${CMAKE_CURRENT_BINARY_DIR}.
+# The arguments *ASSETS* contains a list of assets to be converted during the
+# build. The file hierarchy is conserved in the `${CMAKE_CURRENT_BINARY_DIR}`.
 #
-# If FOLDER option is set, it is organized into its name under the IDE if
+# If *FOLDER* option is set, it is organized into its name under the IDE if
 # supported.
 #
 
--- a/cmake/MolkoDefineTest.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoDefineTest.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,11 +17,13 @@
 #
 
 #
-# molko_define_test
-# -----------------
+# # molko_define_test
+#
+# Create unit test.
 #
-# Synopsis:
+# ## Synopsis
 #
+# ```cmake
 # molko_define_test(
 #   TARGET      target name
 #   SOURCES     src1, src2, srcn
@@ -29,14 +31,17 @@
 #   FLAGS       (Optional) C flags (without -D)
 #   LIBRARIES   (Optional) libraries to link
 #   INCLUDES    (Optional) includes
+# )
+# ```
 #
-# Create an executable with the name TARGET and a test case of the same name
-# with the given SOURCES.
+# Create an executable with the name *TARGET* and a test case of the same name
+# with the given *SOURCES*.
 #
-# Optional include paths, libraries and flags can be specified via INCLUDES,
-# LIBRARIES and FLAGS arguments respectively.
+# Optional include paths, libraries and flags can be specified via *INCLUDES*,
+# *LIBRARIES* and *FLAGS* arguments respectively.
 #
-# If argument ASSETS is set, they are generated in the target binary directory.
+# If argument *ASSETS* is set, they are generated in the target binary
+# directory.
 #
 
 include(${CMAKE_CURRENT_LIST_DIR}/MolkoBuildAssets.cmake)
--- a/cmake/MolkoSetBuildDirectories.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoSetBuildDirectories.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -17,12 +17,15 @@
 #
 
 #
-# molko_set_build_directories
-# ---------------------------
+# # molko_set_build_directories
+#
+# Change build directories for the given target.
 #
-# Synopsis:
+# ## Synopsis
 #
+# ```cmake
 # molko_set_build_directories(target)
+# ```
 #
 # This function will set output directories for the given target. It is
 # necessary so that binaries can know where to find extra data.
--- a/cmake/MolkoSetCompilerFlags.cmake	Mon Nov 30 09:48:52 2020 +0100
+++ b/cmake/MolkoSetCompilerFlags.cmake	Mon Nov 30 10:54:59 2020 +0100
@@ -16,6 +16,21 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
+#
+# # molko_set_compiler_flags
+#
+# Set default compiler flags for the given target.
+#
+# ## Synopsis
+#
+# ```cmake
+# molko_set_compiler_flags(target)
+# ```
+#
+# This function will adds some compiler flags for the development such as
+# warnings, sanitizers if the compiler is compatible.
+#
+
 function(molko_set_compiler_flags target)
 	if (CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
 		target_compile_options(${target} PRIVATE -Wall -Wextra)
--- a/doc/CMakeLists.txt	Mon Nov 30 09:48:52 2020 +0100
+++ b/doc/CMakeLists.txt	Mon Nov 30 10:54:59 2020 +0100
@@ -21,13 +21,14 @@
 find_package(Doxygen QUIET)
 find_program(MKDOCS_EXE mkdocs DOC "Path to mkdocs")
 find_program(DOXYBOOK2_EXE doxybook2 DOC "Path to doxybook2")
+find_program(SH_EXE sh DOC "Path to a POSIX shell")
 
-if (DOXYGEN_FOUND AND MKDOCS_EXE AND DOXYBOOK2_EXE)
+if (DOXYGEN_FOUND AND MKDOCS_EXE AND DOXYBOOK2_EXE AND SH_EXE)
 	set(
 		DOXYGEN_SOURCES
-		libcore
-		libui
-		librpg
+		libmlk-core
+		libmlk-ui
+		libmlk-rpg
 		${doc_SOURCE_DIR}/doxygen/groups.c
 	)
 
@@ -63,45 +64,24 @@
 	set(DOXYGEN_GENERATE_LATEX NO)
 	set(DOXYGEN_GENERATE_MAN NO)
 	set(DOXYGEN_GENERATE_XML YES)
-	set(DOXYGEN_GENERATE_HTML NO)
+	set(DOXYGEN_GENERATE_HTML YES)
 	set(DOXYGEN_INPUT_ENCODING UTF-8)
 	set(DOXYGEN_MAX_INITIALIZER_LINES 0)
 	set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
 	set(DOXYGEN_OUTPUT_DIRECTORY doxygen)
 	set(DOXYGEN_PREDEFINED DOXYGEN)
-	set(DOXYGEN_XML_OUTPUT ${doc_BINARY_DIR}/doxygen-xml)
+	set(DOXYGEN_HTML_OUTPUT ${doc_BINARY_DIR}/doxygen/html)
+	set(DOXYGEN_XML_OUTPUT ${doc_BINARY_DIR}/doxygen/xml)
 	set(DOXYGEN_QUIET YES)
 	set(DOXYGEN_RECURSIVE YES)
 	set(DOXYGEN_TAB_SIZE 8)
 	set(DOXYGEN_WARNINGS YES)
 
-	# 1. Generate XML from doxygen.
-	doxygen_add_docs(
-		doc-doxygen-xml
-		${DOXYGEN_SOURCES}
-		WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
-	)
-
-	# 2. Convert XML through markdown with doxybook2.
-	add_custom_target(
-		doc-doxybook
-		VERBATIM
-		DEPENDS doc-doxygen-xml
+	# 0. Create commands to prepare the output build directory.
+	list(
+		APPEND commands
 		COMMAND
-			${CMAKE_COMMAND} -E make_directory ${doc_BINARY_DIR}/docs
-		COMMAND ${DOXYBOOK2_EXE} -q
-			-i ${doc_BINARY_DIR}/doxygen-xml
-			-o ${doc_BINARY_DIR}/docs
-			-c ${doc_SOURCE_DIR}/doxybook.json
-	)
-
-	# 3. Copy the directory containing hand-made documentation and call mkdocs.
-	add_custom_target(
-		doc
-		VERBATIM
-		DEPENDS doc-doxybook
-		SOURCES ${DOC_SOURCES}
-		WORKING_DIRECTORY ${doc_BINARY_DIR}
+			${CMAKE_COMMAND} -E make_directory ${doc_BINARY_DIR}/docs/cmake
 		COMMAND
 			${CMAKE_COMMAND} -E copy_directory
 				${doc_SOURCE_DIR}/docs
@@ -110,33 +90,70 @@
 			${CMAKE_COMMAND} -E copy
 				${doc_SOURCE_DIR}/mkdocs.yml
 				${doc_BINARY_DIR}
+	)
+
+	# 1. Generate HTML/XML from doxygen.
+	doxygen_add_docs(
+		doc-doxygen
+		${DOXYGEN_SOURCES}
+		WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+	)
+
+	# 2. Use doxybook2 to convert doxygen XML to markdown files.
+	list(
+		APPEND commands
+		COMMAND ${DOXYBOOK2_EXE} -q
+			-i ${doc_BINARY_DIR}/doxygen/xml
+			-o ${doc_BINARY_DIR}/docs
+			-c ${doc_SOURCE_DIR}/doxybook.json
+	)
+
+	# 3. Convert our CMake macros into documentation.
+	set(
+		MACROS
+		${cmake_SOURCE_DIR}/MolkoBuildAssets.cmake
+		${cmake_SOURCE_DIR}/MolkoBuildMaps.cmake
+		${cmake_SOURCE_DIR}/MolkoBuildTilesets.cmake
+		${cmake_SOURCE_DIR}/MolkoBuildTranslations.cmake
+		${cmake_SOURCE_DIR}/MolkoDefineExecutable.cmake
+		${cmake_SOURCE_DIR}/MolkoDefineLibrary.cmake
+		${cmake_SOURCE_DIR}/MolkoDefineTest.cmake
+		${cmake_SOURCE_DIR}/MolkoSetBuildDirectories.cmake
+		${cmake_SOURCE_DIR}/MolkoSetCompilerFlags.cmake
+	)
+
+	foreach (m ${MACROS})
+		get_filename_component(file ${m} NAME_WE)
+		set(output ${doc_BINARY_DIR}/docs/cmake/${file}.md)
+		list(
+			APPEND commands
+			COMMAND ${SH_EXE} ${doc_SOURCE_DIR}/cmake-extract.sh ${m} > ${output}
+		)
+	endforeach ()
+
+	# Create our final targets.
+	add_custom_target(
+		doc
+		VERBATIM
+		DEPENDS doc-doxygen
+		SOURCES ${DOC_SOURCES} ${cmake_outputs}
+		WORKING_DIRECTORY ${doc_BINARY_DIR}
+		${commands}
 		COMMAND
-			${MKDOCS_EXE} build
-				-d ${doc_BINARY_DIR}/html
+			${MKDOCS_EXE} build -d ${doc_BINARY_DIR}/html
 	)
 
 	add_custom_target(
 		doc-serve
 		VERBATIM
-		DEPENDS doc-doxybook
+		DEPENDS doc-doxygen
 		SOURCES ${DOC_SOURCES}
 		WORKING_DIRECTORY ${doc_BINARY_DIR}
-		COMMAND
-			${CMAKE_COMMAND} -E copy_directory
-				${doc_SOURCE_DIR}/docs
-				${doc_BINARY_DIR}/docs
-		COMMAND
-			${CMAKE_COMMAND} -E copy
-				${doc_SOURCE_DIR}/mkdocs.yml
-				${doc_BINARY_DIR}
+		${commands}
 		COMMAND
 			${MKDOCS_EXE} serve
 	)
 
-	set_target_properties(doc doc-serve doc-doxygen-xml doc-doxybook
-		PROPERTIES
-			FOLDER doc
-	)
-
+	set_target_properties(doc doc-doxygen doc-serve PROPERTIES FOLDER doc)
 	source_group(TREE ${doc_SOURCE_DIR}  FILES ${DOC_SOURCES})
 endif ()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/cmake-extract.sh	Mon Nov 30 10:54:59 2020 +0100
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# cmake-extract.sh -- extract documentation from CMake headers
+#
+# CMakeLists.txt -- CMake build system for molko
+#
+# Copyright (c) 2020 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.
+#
+
+prog=$(basename $0)
+
+usage()
+{
+	printf "usage: $prog cmake-file\n" 1>&2
+	exit 1
+}
+
+if [ $# -ne 1 ]; then
+	usage
+fi
+
+#
+# Remove ISC license header then every grep every lines that start with a #
+# and finally remove them.
+#
+
+sed -e "1,19d" "$1" | grep '^#' | sed -e "s/^# *//"
--- a/doc/docs/dev/error.md	Mon Nov 30 09:48:52 2020 +0100
+++ b/doc/docs/dev/error.md	Mon Nov 30 10:54:59 2020 +0100
@@ -65,8 +65,8 @@
 
 The following table shows what is used and when.
 
-|         | `assert`           | Booleans            | panic                                     | Notes                             |
-|---------|--------------------|---------------------|-------------------------------------------|-----------------------------------|
-| libcore | Programming errors | As much as possible | Only in memory utilities from util.h      | Never called from libcore itself. |
-| libui   | Programming errors | When applicable     | Mostly in rendering errors                | None.                             |
-| librpg  | Programming errors | When applicable     | Mostly in rendering errors                | None.                             |
+|             | `assert`           | Booleans            | panic                                     | Notes                             |
+|-------------|--------------------|---------------------|-------------------------------------------|-----------------------------------|
+| libmlk-core | Programming errors | As much as possible | Only in memory utilities from util.h      | Never called from libcore itself. |
+| libmlk-ui   | Programming errors | When applicable     | Mostly in rendering errors                | None.                             |
+| libmlk-rpg  | Programming errors | When applicable     | Mostly in rendering errors                | None.                             |
--- a/doc/docs/dev/faq.md	Mon Nov 30 09:48:52 2020 +0100
+++ b/doc/docs/dev/faq.md	Mon Nov 30 10:54:59 2020 +0100
@@ -37,7 +37,10 @@
 Also, having a large amount of different data types, this would generate very
 large function and type names.
 
-## Why C instead of *FOO*?
+But if there is a high demand of having a proper independant library, it may
+change in the future.
+
+## Why C?
 
 C is an awesome language. It still has its place in the industry especially in
 low-level, kernel and game design.
@@ -64,8 +67,25 @@
 
 There are no plans to create a network oriented core API anytime soon.
 
-## What are these stranges symbols `(+-*&?)` in member fields?
+## What are these strange symbols `(+-*&?)` in member fields?
 
 It's a custom notation to indicate ownership and user access.
 
 See [ownership](ownership.md) file for more information.
+
+## Why not using RPG Maker instead?
+
+RPG Maker is an indeed great piece of software, in fact it's even the original
+source of inspiration for writing Molko's Adventure.
+
+However RPG Maker (in every versions) suffer from:
+
+- Not opensource. RPG Maker is proprietary while Molko's Adventure is licensed
+  under the very liberal [ISC][] license.
+- Per cell movements while Molko's Adventure provides per pixel granularity.
+  This provides more interesting gameplay especially in dungeons.
+- Flexibility. Even though some RPG Maker variants provide Ruby programming,
+  it's still based on GUI to design the game making less possibilities. Molko's
+  Adventure API is a pure C library where you can do mostly what you want.
+
+[ISC]: https://opensource.org/licenses/ISC
--- a/doc/docs/dev/ownership.md	Mon Nov 30 09:48:52 2020 +0100
+++ b/doc/docs/dev/ownership.md	Mon Nov 30 10:54:59 2020 +0100
@@ -67,6 +67,7 @@
 ```c
 struct player {
     const char *name; // Not allocated, no deallocation
+};
 ```
 
 ## Ownership
@@ -120,8 +121,8 @@
 
 ## Memory handling in Molko's Adventure API
 
-|         | Dynamic allocation? | Notes                                                   |
-|---------|---------------------|---------------------------------------------------------|
-| libcore | None                | The util.h provides convenient allocators for the user. |
-| libui   | None                |                                                         |
-| librpg  | In map.h module     | Maps are big chunk of data.                             |
+|             | Dynamic allocation?         | Notes                                                   |
+|-------------|-----------------------------|---------------------------------------------------------|
+| libmlk-core | None                        | The util.h provides convenient allocators for the user. |
+| libmlk-ui   | None                        |                                                         |
+| libmlk-rpg  | In map and tilesets loaders | Maps are big chunk of data.                             |
--- a/doc/mkdocs.yml	Mon Nov 30 09:48:52 2020 +0100
+++ b/doc/mkdocs.yml	Mon Nov 30 10:54:59 2020 +0100
@@ -40,6 +40,16 @@
       - FAQ: dev/faq.md
     - Howto:
       - dev/howto/01-init.md
+    - CMake macros:
+      - cmake/MolkoBuildAssets.md
+      - cmake/MolkoBuildMaps.md
+      - cmake/MolkoBuildTilesets.md
+      - cmake/MolkoBuildTranslations.md
+      - cmake/MolkoDefineExecutable.md
+      - cmake/MolkoDefineLibrary.md
+      - cmake/MolkoDefineTest.md
+      - cmake/MolkoSetBuildDirectories.md
+      - cmake/MolkoSetCompilerFlags.md
     - API Reference:
       - Modules: modules/index.md
       - Files: files/index.md