From 3f1e9c9b02347d0952dede77917f636a5ee7d82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20R=C3=B3=C5=BCewski?= Date: Tue, 23 Apr 2024 16:45:05 +0200 Subject: [PATCH] feat: add demo blizzard project and cleanup (#33) --- CMakeLists.txt | 26 +++++++++++++++++++++----- README.md | 5 +++-- project/mdsanima-blizzard/.gitkeep | 1 - project/mdsanima-blizzard/main.c | 19 +++++++++++++++++++ project/mdsanima-celestial/.gitkeep | 1 - project/mdsanima-deeply/.gitkeep | 1 - project/mdsanima-ember/.gitkeep | 1 - project/mdsanima-firelooy/.gitkeep | 1 - 8 files changed, 43 insertions(+), 12 deletions(-) delete mode 100644 project/mdsanima-blizzard/.gitkeep create mode 100644 project/mdsanima-blizzard/main.c delete mode 100644 project/mdsanima-celestial/.gitkeep delete mode 100644 project/mdsanima-deeply/.gitkeep delete mode 100644 project/mdsanima-ember/.gitkeep delete mode 100644 project/mdsanima-firelooy/.gitkeep diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc41ed..05f1560 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (c) 2024 MDSANIMA LAB. All rights reserved. -# Licensed under the MIT license +# Licensed under the MIT license. cmake_minimum_required(VERSION 3.22) @@ -9,17 +9,33 @@ set(CMAKE_CXX_EXTENSIONS OFF) project(mdsanima VERSION 0.2.0) -# Example +# Example demo programs add_executable(${PROJECT_NAME}-awesome example/mdsanima-awesome/main.c) add_executable(${PROJECT_NAME}-fantastic example/mdsanima-fantastic/main.cc) add_executable(${PROJECT_NAME}-incredible example/mdsanima-incredible/main.cpp) add_executable(${PROJECT_NAME}-stunning example/mdsanima-stunning/main.cxx) -# Project -add_executable(mdsanima-amarok project/mdsanima-amarok/main.c) -add_library(mdsanima STATIC project/mdsanima-amarok/mdsanima.c) +# Project demo programs +add_executable(${PROJECT_NAME}-amarok project/mdsanima-amarok/main.c) +add_executable(${PROJECT_NAME}-blizzard project/mdsanima-blizzard/main.c) + +# Project demo library +add_library(${PROJECT_NAME} STATIC project/mdsanima-amarok/mdsanima.c) + +# Targeting the library target_include_directories(mdsanima INTERFACE project/mdsanima-amarok/) +target_include_directories(mdsanima INTERFACE project/mdsanima-blizzard/) target_link_libraries(mdsanima-amarok mdsanima) +target_link_libraries(mdsanima-blizzard mdsanima) + +# Installation of the demo programs install(TARGETS mdsanima-amarok DESTINATION bin) +install(TARGETS mdsanima-awesome DESTINATION bin) +install(TARGETS mdsanima-blizzard DESTINATION bin) +install(TARGETS mdsanima-fantastic DESTINATION bin) +install(TARGETS mdsanima-incredible DESTINATION bin) +install(TARGETS mdsanima-stunning DESTINATION bin) + +# Installation of the demo library install(TARGETS mdsanima DESTINATION lib) install(FILES project/mdsanima-amarok/mdsanima.h DESTINATION include) diff --git a/README.md b/README.md index 79fd1fa..3c27daa 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Introduction to [CMake](https://cmake.org/) configuration for building and runni > [!NOTE] > To build the sample _demo_ programs that are in the _example_ and _project_ directory, we are > using `cmake` build system command on **WSL** or another virtual machine with a **GNU/Linux** -> system, such as **Debian** or **Ubuntu**. The choice is yours. Currently, we only support the -> _amd64_ architecture. +> system, such as **Debian**, **Ubuntu**, **Fedora**, **CentOS**, and so on. The choice is yours. +> Currently, we only support the _amd64_ architecture. Make sure you have a program called **CMake** installed, as well as a compiler for the **C/C++** languages, typically by entering the following command in the terminal: @@ -42,6 +42,7 @@ You can now run the demo programs by typing the following command inside the `bu ```shell ./mdsanima-amarok ./mdsanima-awesome +./mdsanima-blizzard ./mdsanima-fantastic ./mdsanima-incredible ./mdsanima-stunning diff --git a/project/mdsanima-blizzard/.gitkeep b/project/mdsanima-blizzard/.gitkeep deleted file mode 100644 index 8601d5f..0000000 --- a/project/mdsanima-blizzard/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/project/mdsanima-blizzard/main.c b/project/mdsanima-blizzard/main.c new file mode 100644 index 0000000..b7aaef6 --- /dev/null +++ b/project/mdsanima-blizzard/main.c @@ -0,0 +1,19 @@ +// Copyright (c) 2024 MDSANIMA LAB. All rights reserved. +// Licensed under the MIT license. + +// Simple C implementation of the demo MDSANIMA BLIZZARD project. This project is a simple demo of +// the basic usage of the MDSANIMA C library that can build and run on amd64 GNU/Linux system, such +// as Debian, Ubuntu, Fedora, CentOS, and so on. The main funcionality of this project is to print +// text in the terminal with a color. + +#include +#include + +int main(void) { + const int foregroundColor = 48; + const int backgroundColor = 35; + + cprint(" MDSANIMA BLIZZARD \n", foregroundColor, backgroundColor); + + return 0; +} diff --git a/project/mdsanima-celestial/.gitkeep b/project/mdsanima-celestial/.gitkeep deleted file mode 100644 index 8601d5f..0000000 --- a/project/mdsanima-celestial/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/project/mdsanima-deeply/.gitkeep b/project/mdsanima-deeply/.gitkeep deleted file mode 100644 index 8601d5f..0000000 --- a/project/mdsanima-deeply/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/project/mdsanima-ember/.gitkeep b/project/mdsanima-ember/.gitkeep deleted file mode 100644 index 8601d5f..0000000 --- a/project/mdsanima-ember/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/project/mdsanima-firelooy/.gitkeep b/project/mdsanima-firelooy/.gitkeep deleted file mode 100644 index 8601d5f..0000000 --- a/project/mdsanima-firelooy/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -