Initial commit
This commit is contained in:
93
.gitignore
vendored
Normal file
93
.gitignore
vendored
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
# ---> C++
|
||||||
|
# Prerequisites
|
||||||
|
*.d
|
||||||
|
|
||||||
|
# Compiled Object files
|
||||||
|
*.slo
|
||||||
|
*.lo
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Compiled Dynamic libraries
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
*.dll
|
||||||
|
|
||||||
|
# Fortran module files
|
||||||
|
*.mod
|
||||||
|
*.smod
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
|
||||||
|
# ---> C
|
||||||
|
# Prerequisites
|
||||||
|
*.d
|
||||||
|
|
||||||
|
# Object files
|
||||||
|
*.o
|
||||||
|
*.ko
|
||||||
|
*.obj
|
||||||
|
*.elf
|
||||||
|
|
||||||
|
# Linker output
|
||||||
|
*.ilk
|
||||||
|
*.map
|
||||||
|
*.exp
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Shared objects (inc. Windows DLLs)
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
*.i*86
|
||||||
|
*.x86_64
|
||||||
|
*.hex
|
||||||
|
|
||||||
|
# Debug files
|
||||||
|
*.dSYM/
|
||||||
|
*.su
|
||||||
|
*.idb
|
||||||
|
*.pdb
|
||||||
|
|
||||||
|
# Kernel Module Compile Results
|
||||||
|
*.mod*
|
||||||
|
*.cmd
|
||||||
|
.tmp_versions/
|
||||||
|
modules.order
|
||||||
|
Module.symvers
|
||||||
|
Mkfile.old
|
||||||
|
dkms.conf
|
||||||
|
|
||||||
|
# ---> CMake
|
||||||
|
CMakeLists.txt.user
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
_deps
|
||||||
|
CMakeUserPresets.json
|
||||||
|
|
||||||
|
build
|
||||||
|
bin
|
||||||
|
lib
|
||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "TSE"]
|
||||||
|
path = TSE
|
||||||
|
url = https://git.kerner.dev/yeet/TSE.git
|
||||||
27
.vscode/c_cpp_properties.json
vendored
Normal file
27
.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/DemoProject/include",
|
||||||
|
"${workspaceFolder}/DemoProject/src",
|
||||||
|
"${workspaceFolder}/TSE/TSE_Base/include",
|
||||||
|
"${workspaceFolder}/TSE/TSE_Base/src",
|
||||||
|
"${workspaceFolder}/TSE/TSE_Core/include",
|
||||||
|
"${workspaceFolder}/TSE/TSE_Core/src",
|
||||||
|
"${workspaceFolder}/TSE/TSE_Math/src",
|
||||||
|
"${workspaceFolder}/TSE/TSE_GlfwImpl/include",
|
||||||
|
"${workspaceFolder}/TSE/TSE_GlfwImpl/src",
|
||||||
|
"${workspaceFolder}/TSE/TSE_GlfwOpenGlImpl/include",
|
||||||
|
"${workspaceFolder}/TSE/TSE_GlfwOpenGlImpl/src",
|
||||||
|
"${workspaceFolder}/TSE/TSE_Editor/src"
|
||||||
|
],
|
||||||
|
"defines": [],
|
||||||
|
"compilerPath": "/usr/bin/clang++",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "c++20",
|
||||||
|
"intelliSenseMode": "clang-x64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
30
.vscode/launch.json
vendored
Normal file
30
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Debug Linux",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"program": "${workspaceFolder}/bin/DemoProject",
|
||||||
|
"preLaunchTask": "build_debug_linux",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"cwd": "${workspaceFolder}/bin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug Windows",
|
||||||
|
"type": "cppvsdbg",
|
||||||
|
"request": "launch",
|
||||||
|
//"MIMode": "gdb",
|
||||||
|
"program": "${workspaceFolder}/bin/DemoProject",
|
||||||
|
"preLaunchTask": "build_debug_linux",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"cwd": "${workspaceFolder}/bin"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
93
.vscode/tasks.json
vendored
Normal file
93
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
//Build Linux
|
||||||
|
|
||||||
|
{
|
||||||
|
"label": "make_linux",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "cmake",
|
||||||
|
"args": [
|
||||||
|
"--build",
|
||||||
|
"${workspaceFolder}/build",
|
||||||
|
"--target",
|
||||||
|
"all"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build_debug_linux_cmake",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "cmake",
|
||||||
|
"args": [
|
||||||
|
"-S",
|
||||||
|
"${workspaceFolder}/.",
|
||||||
|
"-B",
|
||||||
|
"${workspaceFolder}/./build",
|
||||||
|
"-DDEBUG=ON",
|
||||||
|
"-G Ninja",
|
||||||
|
"-DCMAKE_C_COMPILER=clang",
|
||||||
|
"-DCMAKE_CXX_COMPILER=clang++",
|
||||||
|
"-DCMAKE_LINKER=lld-link",
|
||||||
|
"-DCMAKE_BUILD_TYPE=Debug"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build_release_linux_cmake",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "cmake",
|
||||||
|
"args": [
|
||||||
|
"-S",
|
||||||
|
"${workspaceFolder}/.",
|
||||||
|
"-B",
|
||||||
|
"${workspaceFolder}/./build",
|
||||||
|
"-DDEBUG=OFF",
|
||||||
|
"-G Ninja",
|
||||||
|
"-DCMAKE_C_COMPILER=clang",
|
||||||
|
"-DCMAKE_CXX_COMPILER=clang++",
|
||||||
|
"-DCMAKE_LINKER=lld-link",
|
||||||
|
"-DCMAKE_BUILD_TYPE=Release"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build_debug_linux",
|
||||||
|
"dependsOn": [
|
||||||
|
"build_debug_linux_cmake",
|
||||||
|
"make_linux"
|
||||||
|
],
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build_release_linux",
|
||||||
|
"dependsOn": [
|
||||||
|
"build_release_linux_cmake",
|
||||||
|
"make_linux"
|
||||||
|
],
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
129
CMakeLists.txt
Normal file
129
CMakeLists.txt
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
#cmake version
|
||||||
|
cmake_minimum_required(VERSION 3.31)
|
||||||
|
|
||||||
|
#project name
|
||||||
|
project(DemoProject)
|
||||||
|
|
||||||
|
#cpp settings
|
||||||
|
find_program(CLANG_C NAMES clang)
|
||||||
|
find_program(CLANG_CXX NAMES clang++)
|
||||||
|
|
||||||
|
if(CLANG_C AND CLANG_CXX)
|
||||||
|
message(STATUS "foung Clang, using as Compiler")
|
||||||
|
set(CMAKE_C_COMPILER ${CLANG_C} CACHE STRING "C Compiler" FORCE)
|
||||||
|
set(CMAKE_CXX_COMPILER ${CLANG_CXX} CACHE STRING "C++ Compiler" FORCE)
|
||||||
|
else()
|
||||||
|
message(STATUS "Clang not found, using Standard-Compiler")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
|
#project output settings
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/bin")
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_SOURCE_DIR}/bin")
|
||||||
|
|
||||||
|
#engine projects
|
||||||
|
add_subdirectory(TSE/TSE_Base)
|
||||||
|
add_subdirectory(TSE/TSE_Math)
|
||||||
|
add_subdirectory(TSE/TSE_Core)
|
||||||
|
add_subdirectory(TSE/TSE_Editor)
|
||||||
|
add_subdirectory(TSE/TSE_GlfwImpl)
|
||||||
|
add_subdirectory(TSE/TSE_GlfwOpenGlImpl)
|
||||||
|
find_package(Lua 5.4 REQUIRED)
|
||||||
|
|
||||||
|
#source files
|
||||||
|
file(GLOB CPP_SOURCE
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*/*.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*.c"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*.c"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*.c"
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/src/*/*/*/*.c"
|
||||||
|
)
|
||||||
|
|
||||||
|
#includes
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/DemoProject/src)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/DemoProject/include)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Math/src)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Core/src)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Base/src)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Base/include)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_Editor/src)
|
||||||
|
|
||||||
|
#includes Glfw
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwImpl/src)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwImpl/include)
|
||||||
|
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwOpenGlImpl/src)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwOpenGlImpl/include)
|
||||||
|
|
||||||
|
#project def
|
||||||
|
add_executable(DemoProject ${CPP_SOURCE})
|
||||||
|
|
||||||
|
target_include_directories(DemoProject PRIVATE ${LUA_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
if(DEBUG)
|
||||||
|
set(DEBUGSPEC
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include/FreeImageLib.d.lib"
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include/box2dd.lib"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set(DEBUGSPEC
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include/FreeImageLib.r.lib"
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include/box2d.lib"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set(LIB_SOURCE
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwImpl/include/glfw3.lib"
|
||||||
|
# "${PROJECT_SOURCE_DIR}/../TSE.Core/lib/freetype.lib"
|
||||||
|
"${DEBUGSPEC}"
|
||||||
|
"${LUA_LIBRARIES}"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set(LIB_SOURCE
|
||||||
|
# "${PROJECT_SOURCE_DIR}/../TSE.Core/lib/libfreetype.a"
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include/libfreeimage.a"
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_GlfwImpl/include/libglfw3.a"
|
||||||
|
"${PROJECT_SOURCE_DIR}/TSE/TSE_Core/include/libbox2d.a"
|
||||||
|
"${LUA_LIBRARIES}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
target_link_libraries(DemoProject PUBLIC
|
||||||
|
TSE_Base
|
||||||
|
TSE_Math
|
||||||
|
TSE_Core
|
||||||
|
TSE_GlfwImpl
|
||||||
|
TSE_GlfwOpenGlImpl
|
||||||
|
TSE_Editor
|
||||||
|
${LIB_SOURCE})
|
||||||
|
else()
|
||||||
|
target_link_libraries(DemoProject PUBLIC
|
||||||
|
TSE_Editor
|
||||||
|
TSE_GlfwOpenGlImpl
|
||||||
|
TSE_GlfwImpl
|
||||||
|
TSE_Core
|
||||||
|
TSE_Math
|
||||||
|
TSE_Base
|
||||||
|
${LIB_SOURCE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#flags
|
||||||
|
target_compile_options(DemoProject PRIVATE -march=native)
|
||||||
|
|
||||||
|
set(TARGET_DIR "${PROJECT_SOURCE_DIR}/bin")
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET DemoProject
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
"${PROJECT_SOURCE_DIR}/DemoProject/Resources"
|
||||||
|
"${TARGET_DIR}"
|
||||||
|
COMMENT "📂 Kopiere Resources/ nach bin/ nach Buildabschluss\n"
|
||||||
|
)
|
||||||
BIN
DemoProject/Resources/test.png
Normal file
BIN
DemoProject/Resources/test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 608 B |
3
DemoProject/include/globalVars.hpp
Normal file
3
DemoProject/include/globalVars.hpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define PROJECT_NAME "DemoProject"
|
||||||
86
DemoProject/src/main.cpp
Normal file
86
DemoProject/src/main.cpp
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "GL/gl3w.h"
|
||||||
|
#include "globalVars.hpp"
|
||||||
|
#include "WindowGlfw.hpp"
|
||||||
|
#include "OpenGLRenderingBackend.hpp"
|
||||||
|
#include "imgui/imgui.h"
|
||||||
|
#include "shader/defaultShaderHandler.cpp"
|
||||||
|
#include "DefaultRendererOpenGL.hpp"
|
||||||
|
#include "BehaviourScripts/RectBase.hpp"
|
||||||
|
#include "BehaviourScripts/Renderable.hpp"
|
||||||
|
#include "BehaviourScripts/Camera.hpp"
|
||||||
|
#include "elements/Sprite.hpp"
|
||||||
|
#include "elements/Texture.hpp"
|
||||||
|
#include "elements/Layer.hpp"
|
||||||
|
#include "elements/Scene.hpp"
|
||||||
|
#include "EditorSubsystem.hpp"
|
||||||
|
|
||||||
|
using namespace TSE;
|
||||||
|
using namespace TSE::GLFW;
|
||||||
|
using namespace TSE::EDITOR;
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
IWindow* wnd = new WindowGlfw("DemoProject", 600, 400, new OpenGLRenderingBackend(Color::aqua, false, 4, true));
|
||||||
|
EditorSubsystem editor;
|
||||||
|
LoadBasicShaders(600, 400);
|
||||||
|
|
||||||
|
DefaultRendererOpenGL rnd = DefaultRendererOpenGL(*BasicShader::Instance());
|
||||||
|
|
||||||
|
#pragma region obj1
|
||||||
|
|
||||||
|
Transformable* obj1 = new Transformable("testObj");
|
||||||
|
|
||||||
|
RectBase rb = RectBase();
|
||||||
|
obj1->AddBehaviourScript(&rb);
|
||||||
|
Material mat = Material("testMat", BasicShader::Instance());
|
||||||
|
mat.SetValue<Color>("mainColor", Color::black);
|
||||||
|
Renderable r = Renderable(&mat);
|
||||||
|
obj1->AddBehaviourScript(&r);
|
||||||
|
obj1->position = Vector3(0,0,0);
|
||||||
|
obj1->scale = Vector3(8,1,1);
|
||||||
|
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
Layer game("game");
|
||||||
|
|
||||||
|
game.AddTransformable(obj1);
|
||||||
|
|
||||||
|
Scene scene;
|
||||||
|
scene.AddLayer(&game);
|
||||||
|
scene.AddLayer(&editor.editorLayer);
|
||||||
|
|
||||||
|
//((Camera*)(editor.editorLayer.GetAllObjects()[0]->GetBehaviourScriptAt(0)))->SetRenderTarget(wnd);
|
||||||
|
|
||||||
|
editor.hv.SetScene(&scene);
|
||||||
|
|
||||||
|
while(!wnd->ShouldClose())
|
||||||
|
{
|
||||||
|
wnd->Clear();
|
||||||
|
rnd.Begin();
|
||||||
|
|
||||||
|
scene.Render(rnd, *wnd);
|
||||||
|
|
||||||
|
rnd.End();
|
||||||
|
rnd.Flush();
|
||||||
|
|
||||||
|
scene.DoneRender();
|
||||||
|
|
||||||
|
//editor.sv.Render();
|
||||||
|
editor.controller.Update();
|
||||||
|
//ImGui::ShowDemoWindow();
|
||||||
|
wnd->Update();
|
||||||
|
scene.Update();
|
||||||
|
}
|
||||||
|
UnLoadBasicShaders();
|
||||||
|
Transformable::DeleteAll();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; // NVIDIA
|
||||||
|
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; // AMD
|
||||||
|
}
|
||||||
|
#endif
|
||||||
18
LICENSE
Normal file
18
LICENSE
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 yeet
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||||
|
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||||
|
portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||||
|
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||||
|
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
96
ProjectConfigurator.sh
Executable file
96
ProjectConfigurator.sh
Executable file
@@ -0,0 +1,96 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Intro
|
||||||
|
# -----------------------------
|
||||||
|
echo "Project Configurator"
|
||||||
|
echo "--------------------"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Projektname abfragen
|
||||||
|
# -----------------------------
|
||||||
|
read -rp "What should the project be called? " PROJECT_NAME
|
||||||
|
|
||||||
|
if [[ -z "$PROJECT_NAME" ]]; then
|
||||||
|
echo "Project name cannot be empty."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! "$PROJECT_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then
|
||||||
|
echo "Invalid project name. Use only letters, numbers, _ or -"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Ordner umbenennen
|
||||||
|
# -----------------------------
|
||||||
|
if [ ! -d "__Project_Name__" ]; then
|
||||||
|
echo "Placeholder directory '__Project_Name__' not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Renaming project directory..."
|
||||||
|
mv "__Project_Name__" "$PROJECT_NAME"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# CMakeLists.txt anpassen
|
||||||
|
# -----------------------------
|
||||||
|
if [ ! -f "CMakeLists.txt" ]; then
|
||||||
|
echo "CMakeLists.txt not found in root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Updating CMakeLists.txt..."
|
||||||
|
sed -i "s/__Project_Name__/$PROJECT_NAME/g" CMakeLists.txt
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# globalVars.hpp anpassen
|
||||||
|
# -----------------------------
|
||||||
|
GLOBAL_VARS_PATH="$PROJECT_NAME/include/globalVars.hpp"
|
||||||
|
|
||||||
|
if [ ! -f "$GLOBAL_VARS_PATH" ]; then
|
||||||
|
echo "globalVars.hpp not found in root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Updating globalVars.hpp..."
|
||||||
|
sed -i "s/__Project_Name__/$PROJECT_NAME/g" "$GLOBAL_VARS_PATH"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Git Submodule aktualisieren
|
||||||
|
# -----------------------------
|
||||||
|
if [ -f ".gitmodules" ]; then
|
||||||
|
echo "Initializing and updating submodules..."
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
echo "Updating submodules to latest main branch..."
|
||||||
|
git submodule foreach '
|
||||||
|
git fetch origin &&
|
||||||
|
git checkout main &&
|
||||||
|
git pull origin main
|
||||||
|
'
|
||||||
|
else
|
||||||
|
echo "No submodules found. Skipping."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Git vorbereiten
|
||||||
|
# -----------------------------
|
||||||
|
echo "Preparing git repository..."
|
||||||
|
|
||||||
|
# falls das Repo aus Template kommt, existiert Git schon
|
||||||
|
git add .
|
||||||
|
git commit -m "Configure project $PROJECT_NAME"
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Ziel-Repository pushen
|
||||||
|
# -----------------------------
|
||||||
|
|
||||||
|
git push -u origin main
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Fertig
|
||||||
|
# -----------------------------
|
||||||
|
echo "Done."
|
||||||
|
echo "Project '$PROJECT_NAME' is ready."
|
||||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# TSE_Project_Template
|
||||||
|
|
||||||
|
this is a template for using TSE
|
||||||
1
TSE
Submodule
1
TSE
Submodule
Submodule TSE added at 473ff0840d
Reference in New Issue
Block a user