From 7069bfb303e86354406c94d59e1e2e47f126c984 Mon Sep 17 00:00:00 2001 From: lvntky Date: Mon, 18 Nov 2024 22:45:57 +0300 Subject: initial --- example/CMakeLists.txt | 24 ++++++++++++++++++++++++ example/empty_example | Bin 0 -> 15720 bytes example/empty_example.c | 14 ++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 example/CMakeLists.txt create mode 100755 example/empty_example create mode 100644 example/empty_example.c (limited to 'example') diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 0000000..411945a --- /dev/null +++ b/example/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.21) + +project(fbglExamples C) + +include(../cmake/folders.cmake) + +if(PROJECT_IS_TOP_LEVEL) + find_package(fbgl REQUIRED) +endif() + +add_custom_target(run-examples) + +function(add_example NAME) + add_executable("${NAME}" "${NAME}.c") + target_link_libraries("${NAME}" PRIVATE fbgl::fbgl) + target_compile_features("${NAME}" PRIVATE c_std_99) + add_custom_target("run_${NAME}" COMMAND "${NAME}" VERBATIM) + add_dependencies("run_${NAME}" "${NAME}") + add_dependencies(run-examples "run_${NAME}") +endfunction() + +add_example(empty_example) + +add_folders(Example) diff --git a/example/empty_example b/example/empty_example new file mode 100755 index 0000000..e19c325 Binary files /dev/null and b/example/empty_example differ diff --git a/example/empty_example.c b/example/empty_example.c new file mode 100644 index 0000000..c275526 --- /dev/null +++ b/example/empty_example.c @@ -0,0 +1,14 @@ +#define FBGL_IMPLEMENTATION +#include "../include/fbgl/fbgl.h" + +#include + +int main() +{ + printf("version %s\n", fbgl_version_info()); + printf("name %s\n", fbgl_name_info()); + fbgl_t buffer; + fbgl_init("/dev/fb0", &buffer); + + return 0; +} -- cgit v1.2.3