Add first version of CMake framework code
This commit adds the core elements of the framework and documentation:
- Map utility: store key-value pairs.
- Group utility: store build configuration options.
- STGT API: describe the targets.
- Compiler abstraction functions for GCC.
- Other helper functions.
- New CMake system type called "Embedded", using correct output file
prefixes and extensions.
- Sphinx based documentation which includes:
- licensing information
- version numbering policy
- documentation on how-to build the documentation
In addition the following utility files are added:
- .editorconfig
- .gitignore
Change-Id: If19a171ef066775d3544fba82f1cc70a5fb0e7d7
Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Co-authored-by: Gyorgy Szing <gyorgy.szing@arm.com>
Co-authored-by: Bence Szépkúti <bence.szepkuti@arm.com>
diff --git a/Common/Utils.cmake b/Common/Utils.cmake
new file mode 100644
index 0000000..d93dcee
--- /dev/null
+++ b/Common/Utils.cmake
@@ -0,0 +1,37 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#[===[.rst:
+Misc utilities
+--------------
+#]===]
+
+include_guard(DIRECTORY)
+
+#[===[.rst:
+.. cmake:command:: check_args
+
+ .. code-block:: cmake
+
+ check_args(func_name REQ_ARG1 REQ_ARG2)
+
+ Helper macro for argument checking in functions. First argument *func_name* is
+ the name of the function, other arguments are the names of the required
+ arguments to that function. The macro iterates through the list, and prints
+ and error message if not all arguments are defined.
+
+#]===]
+macro(check_args)
+ set(_argv "${ARGV}")
+ list(SUBLIST _argv 0 1 _func)
+ list(SUBLIST _argv 1 -1 _args)
+ foreach(_arg IN LISTS _args)
+ if (NOT DEFINED _MY_PARAMS_${_arg})
+ message(FATAL_ERROR "${_func}(): mandatory parameter '${_arg}' missing.")
+ endif()
+ endforeach()
+endmacro()