diff --git a/CMakeLists.txt b/CMakeLists.txt index 2137fa5..a59fe91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,18 +9,20 @@ set(CMAKE_CXX_EXTENSIONS OFF) project(mdsanima VERSION 0.2.1) -# Example demo fantastic program +# Example demo program fantastic add_executable(${PROJECT_NAME}-fantastic example/mdsanima-fantastic/main.cc) add_library(fantastic SHARED example/mdsanima-fantastic/lib.cc) target_link_libraries(${PROJECT_NAME}-fantastic fantastic) -# Example demo incredible program +# Example demo program incredible add_executable(${PROJECT_NAME}-incredible example/mdsanima-incredible/main.cpp) add_library(incredible SHARED example/mdsanima-incredible/lib.cpp) target_link_libraries(${PROJECT_NAME}-incredible incredible) -# Example demo stunning program +# Example demo program stunning add_executable(${PROJECT_NAME}-stunning example/mdsanima-stunning/main.cxx) +add_library(stunning SHARED example/mdsanima-stunning/lib.cxx) +target_link_libraries(${PROJECT_NAME}-stunning stunning) # Project demo programs add_executable(${PROJECT_NAME}-amarok project/mdsanima-amarok/main.c) diff --git a/example/mdsanima-stunning/lib.cxx b/example/mdsanima-stunning/lib.cxx new file mode 100644 index 0000000..e83ec46 --- /dev/null +++ b/example/mdsanima-stunning/lib.cxx @@ -0,0 +1,10 @@ +// Copyright (c) 2024 MDSANIMA LAB. All rights reserved. +// Licensed under the MIT license. + +// Simple C++ example demo of `STUNNING` shared library implementation. + +#include "lib.hxx" + +#include + +void mprint(const char* text) { std::cout << text << '\n'; } diff --git a/example/mdsanima-stunning/lib.hxx b/example/mdsanima-stunning/lib.hxx new file mode 100644 index 0000000..ee8d938 --- /dev/null +++ b/example/mdsanima-stunning/lib.hxx @@ -0,0 +1,13 @@ +// Copyright (c) 2024 MDSANIMA LAB. All rights reserved. +// Licensed under the MIT license. + +// Simple C++ example demo of `STUNNING` shared library header file. + +#pragma once + +/** + * Simple text message printing implementation for the demo purpose only. + * + * @param text The text message to print in the terminal. + */ +void mprint(const char* text); diff --git a/example/mdsanima-stunning/main.cxx b/example/mdsanima-stunning/main.cxx index 2e5b45b..849e4ad 100644 --- a/example/mdsanima-stunning/main.cxx +++ b/example/mdsanima-stunning/main.cxx @@ -1,8 +1,11 @@ // Copyright (c) 2024 MDSANIMA LAB. All rights reserved. // Licensed under the MIT license. -// Simple C++ implementation of the example `MDSANIMA STUNNING` demo project. +// The main C++ program of `MDSANIMA STUNNING` example demo project. -#include +#include "lib.hxx" -auto main() -> int { std::cout << "Hello World from the MDSANIMA STUNNING" << '\n'; } +auto main() -> int { + const char* message = "Hello World from the MDSANIMA STUNNING"; + mprint(message); +}