diff cmake/MalikaniaOptions.cmake @ 182:3107ce017c3a

Misc: switch back to SDL Qt Quick and QML was an exciting experiment but it's definitely not enough flexible and easy to use for game development. Using SDL2 will let us focusing on our own drawing functions without any kind of overhead. While here, start massive cleanup.
author David Demelier <markand@malikania.fr>
date Fri, 19 Oct 2018 20:18:19 +0200
parents 3e3040d085b5
children 387f6b0a5420
line wrap: on
line diff
--- a/cmake/MalikaniaOptions.cmake	Fri Oct 12 20:24:40 2018 +0200
+++ b/cmake/MalikaniaOptions.cmake	Fri Oct 19 20:18:19 2018 +0200
@@ -17,12 +17,51 @@
 #
 
 #
+# Backend selection.
+# -------------------------------------------------------------------
+#
+# The following options are available:
+#    WITH_BACKEND        - Type of backend to use. (Default: SDL)
+#
+
+set(WITH_BACKEND "SDL"
+    CACHE STRING "Which backend to use")
+
+#
+# Documentation and technical references
+# -------------------------------------------------------------------
+#
+# The following options are available:
+#    WITH_DOCS            - Disable or enable all docs, if set to Off, disable all documentation.
+#    WITH_DOXYGEN         - Enable doxygen
+#
+
+option(WITH_DOCS "Build all documentation" On)
+option(WITH_DOXYGEN "Enable doxygen generation" On)
+
+if (NOT WITH_DOCS)
+    set(WITH_DOXYGEN Off)
+endif ()
+
+set(WITH_DRIVERDIR "lib/malikania/${MALIKANIA_VERSION}"
+    CACHE STRING "Database driver directory")
+set(WITH_BINDIR "libexec/malikania/${MALIKANIA_VERSION}"
+    CACHE STRING "Front end directory")
+
+if (IS_ABSOLUTE ${WITH_DRIVERDIR})
+    message(FATAL_ERROR "WITH_DRIVERDIR must not be absolute")
+elseif (IS_ABSOLUTE ${WITH_BINDIR})
+    message(FATAL_ERROR "WITH_BINDIR must not be absolute")
+endif ()
+
+#
 # Options for development.
 # -------------------------------------------------------------------
 #
 
 option(WITH_VERA "Enable vera++ analyzer" On)
 option(WITH_TESTS "Enable unit tests" On)
+option(WITH_EXAMPLES "Enable examples" On)
 
 find_program(VERA_EXECUTABLE vera++)
 
@@ -54,6 +93,12 @@
     malikania_setg(WITH_TESTS_MSG "Yes")
 endif ()
 
+if (NOT WITH_EXAMPLES)
+    malikania_setg(WITH_EXAMPLES_MSG "No (disabled by user)")
+else ()
+    malikania_setg(WITH_EXAMPLES_MSG "Yes")
+endif ()
+
 #
 # Options for unit tests
 # -------------------------------------------------------------------
@@ -80,7 +125,13 @@
 option(WITH_LIBCLIENT "Build libclient" On)
 option(WITH_LIBSERVER "Build libserver" On)
 
+if (WITH_BACKEND MATCHES "SDL")
+    set(WITH_BACKEND_DIR "backend/sdl")
+else ()
+    message(FATAL_ERROR "Unknown backend selected: ${WITH_BACKEND}")
+endif ()
+
 configure_file(
-    ${malikania_SOURCE_DIR}/cmake/internal/sysconfig-tests.hpp.in
-    ${malikania_BINARY_DIR}/sysconfig-tests.hpp
+    ${malikania_SOURCE_DIR}/cmake/internal/sysconfig-tests.h
+    ${malikania_BINARY_DIR}/sysconfig-tests.h
 )