From d23636e70dcb558ab287c409e4f53a8f93912134 Mon Sep 17 00:00:00 2001 From: Skittles Date: Thu, 23 Apr 2026 20:44:31 -0700 Subject: [PATCH] Initial project files --- .clang-format | 1 + .gitea/workflows/demo.yaml | 19 ++++++++++++++ .gitignore | 2 ++ CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++++++ CMakePresets.json | 31 ++++++++++++++++++++++ app/CMakeLists.txt | 7 +++++ app/main.cpp | 6 +++++ doc/CMakeLists.txt | 9 +++++++ src/CMakeLists.txt | 0 test/CMakeLists.txt | 0 vcpkg-configuration.json | 14 ++++++++++ vcpkg.json | 5 ++++ 12 files changed, 148 insertions(+) create mode 100644 .clang-format create mode 100644 .gitea/workflows/demo.yaml create mode 100644 CMakeLists.txt create mode 100644 CMakePresets.json create mode 100644 app/CMakeLists.txt create mode 100644 app/main.cpp create mode 100644 doc/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..468ceea --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: LLVM \ No newline at end of file diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml new file mode 100644 index 0000000..394c807 --- /dev/null +++ b/.gitea/workflows/demo.yaml @@ -0,0 +1,19 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/.gitignore b/.gitignore index 52336df..9001f01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +build/ + # ---> C++ # Prerequisites *.d diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9630827 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.15...4.3) +project( + EmbeddedLinuxSandbox + VERSION 0.1 + DESCRIPTION "LR-EnviroCommand" + LANGUAGES CXX +) + +# Only do these if this is the main project, and not if it is included through add_subdirectory +if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + + # Optionally set things like CMAKE_CXX_STANDARD, CMAKE_POSITION_INDEPENDENT_CODE here + + # Let's ensure -std=c++xx instead of -std=g++xx + set(CMAKE_CXX_EXTENSIONS OFF) + + # Let's nicely support folders in IDEs + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + + # Testing only available if this is the main app + # Note this needs to be done in the main CMakeLists + # since it calls enable_testing, which must be in the + # main CMakeLists. + include(CTest) + + # Docs only available if this is the main app + find_package(Doxygen) + if (Doxygen_FOUND) + add_subdirectory(doc) + else () + message(STATUS "Doxygen not found, not building docs") + endif () +endif () + +# Packages + + +# Setup Qt QML +find_package(Qt6 6.10 COMPONENTS Network Quick REQUIRED) +qt_standard_project_setup(REQUIRES 6.10) + +# FetchContent added in CMake 3.11, downloads during the configure step +# FetchContent_MakeAvailable was added in CMake 3.14; simpler usage +include(FetchContent) + +# Add subdirectories for project +add_subdirectory(src) +add_subdirectory(app) + +# Testing only available if this is the main app +if ((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + AND BUILD_TESTING) + add_subdirectory(test) +endif () \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..e714060 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,31 @@ +{ + "version": 10, + "configurePresets": [ + { + "name": "vcpkg", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build", + "hidden": true, + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + } + }, + { + "name": "debug", + "inherits": "vcpkg", + "displayName": "Debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "release", + "inherits": "vcpkg", + "displayName": "Release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ] +} \ No newline at end of file diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt new file mode 100644 index 0000000..094eb35 --- /dev/null +++ b/app/CMakeLists.txt @@ -0,0 +1,7 @@ +set(target mainApp) + +add_executable(${target} main.cpp) + +target_compile_features(${target} PRIVATE cxx_std_23) + +# target_link_libraries(${target} PRIVATE) \ No newline at end of file diff --git a/app/main.cpp b/app/main.cpp new file mode 100644 index 0000000..2963996 --- /dev/null +++ b/app/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::println("Test\n"); + return 0; +} \ No newline at end of file diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..c701d7c --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,9 @@ +set(DOXYGEN_EXTRACT_ALL YES) +set(DOXYGEN_BUILTIN_STL_SUPPORT YES) +set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md) + +doxygen_add_docs(docs_target + ${PROJECT_SOURCE_DIR}/src + ALL # does not seem to work + COMMENT "Generate HTML documentation" +) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..80f1128 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,14 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "7147ac1294ef9647e8679e1183ac440a5d0a63b7", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..740d8b1 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,5 @@ +{ + "dependencies": [ + "qtbase" + ] +} \ No newline at end of file