Created project structure
authorNils Forssén <forssennils@gmail.com>
Wed, 12 Jun 2024 21:35:41 +0000 (23:35 +0200)
committerNils Forssén <forssennils@gmail.com>
Wed, 12 Jun 2024 21:35:41 +0000 (23:35 +0200)
.gitignore [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
CMakePresets.json [new file with mode: 0644]
README.md [new file with mode: 0644]
build.sh [new file with mode: 0755]
include/test.h [new file with mode: 0644]
lib/mavlink [new submodule]
run.sh [new file with mode: 0755]
src/CMakeLists.txt [new file with mode: 0644]
src/main.cpp [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..8179d18
--- /dev/null
@@ -0,0 +1,3 @@
+out/
+bin/
+.vscode/
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..74538e1
--- /dev/null
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.0.0)
+project(client VERSION 0.1.0 LANGUAGES CXX)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
+
+add_subdirectory(src)
+add_subdirectory(lib/mavlink)
\ No newline at end of file
diff --git a/CMakePresets.json b/CMakePresets.json
new file mode 100644 (file)
index 0000000..869e79f
--- /dev/null
@@ -0,0 +1,17 @@
+{
+    "version": 8,
+    "configurePresets": [
+        {
+            "name": "client_toolchain",
+            "displayName": "Configure preset using toolchain file",
+            "description": "Sets Ninja generator, build and install directory",
+            "generator": "Ninja",
+            "binaryDir": "${sourceDir}/out/build/${presetName}",
+            "cacheVariables": {
+                "CMAKE_BUILD_TYPE": "Debug",
+                "CMAKE_TOOLCHAIN_FILE": "",
+                "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
+            }
+        }
+    ]
+}
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..18ff068
--- /dev/null
+++ b/README.md
@@ -0,0 +1,9 @@
+# Installation
+
+Enable fan pin 20 through raspi-config
+
+```
+sudo apt install -y cmake build-essential checkinstall zlib1g-dev libssl-dev python3 python3-pip ninja-build git
+
+
+```
\ No newline at end of file
diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
index 0000000..195c2cb
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/bash
+
+cd $(dirname "$0")/out/build/client_toolchain
+ninja
\ No newline at end of file
diff --git a/include/test.h b/include/test.h
new file mode 100644 (file)
index 0000000..34889fd
--- /dev/null
@@ -0,0 +1 @@
+#include <iostream>
\ No newline at end of file
diff --git a/lib/mavlink b/lib/mavlink
new file mode 160000 (submodule)
index 0000000..5575efc
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 5575efc01ea280e2f5d8a655a5ee1387f4b46f30
diff --git a/run.sh b/run.sh
new file mode 100755 (executable)
index 0000000..72c9097
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/bash
+
+cd $(dirname "$0")/bin
+./client
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3d4149b
--- /dev/null
@@ -0,0 +1,7 @@
+add_executable(client
+    main.cpp
+)
+
+target_include_directories(client PRIVATE ${CMAKE_SOURCE_DIR}/include)
+
+target_link_libraries(client PUBLIC MAVLink)
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644 (file)
index 0000000..2a94894
--- /dev/null
@@ -0,0 +1,9 @@
+#include <cstdio>
+#include "test.h"
+#include <common/mavlink.h>
+
+int main(int, char**){
+    printf("Hello, from clientcamera!\n");
+
+    return 0;
+}