Skip to content

Commit

Permalink
feat: add demo blizzard project and cleanup (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsanima authored Apr 23, 2024
1 parent fb501b2 commit 3f1e9c9
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 12 deletions.
26 changes: 21 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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)
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion project/mdsanima-blizzard/.gitkeep

This file was deleted.

19 changes: 19 additions & 0 deletions project/mdsanima-blizzard/main.c
Original file line number Diff line number Diff line change
@@ -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 <mdsanima.h>
#include <stdio.h>

int main(void) {
const int foregroundColor = 48;
const int backgroundColor = 35;

cprint(" MDSANIMA BLIZZARD \n", foregroundColor, backgroundColor);

return 0;
}
1 change: 0 additions & 1 deletion project/mdsanima-celestial/.gitkeep

This file was deleted.

1 change: 0 additions & 1 deletion project/mdsanima-deeply/.gitkeep

This file was deleted.

1 change: 0 additions & 1 deletion project/mdsanima-ember/.gitkeep

This file was deleted.

1 change: 0 additions & 1 deletion project/mdsanima-firelooy/.gitkeep

This file was deleted.

0 comments on commit 3f1e9c9

Please sign in to comment.