Skip to content
Snippets Groups Projects
Commit 7c33c4be authored by David Maul's avatar David Maul :crab:
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
build/
out/
cmake-build-*/
.idea/
.vscode/
*.swp
*.swo
*~
*.o
*.obj
*.exe
*.dll
*.so
*.dylib
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
compile_commands.json
CTestTestfile.cmake
Testing/
_deps/
conan/
vcpkg_installed/
conanbuildinfo.*
conaninfo.*
*.pdb
*.ilk
*.exp
*.lib
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.log
*.tlog
*.tmp
*.temp
*.gcno
*.gcda
*.gcov
coverage/
docs/generated/
bin/
lib/
cmake_minimum_required(VERSION 3.15)
# Projektname und Sprache
project(cpp-project
VERSION 1.0.0
DESCRIPTION "HSFD C++ Project"
LANGUAGES CXX
)
# C++ Standard festlegen
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Compiler-Warnungen aktivieren
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Executable erstellen
add_executable(${PROJECT_NAME}
src/main.cpp
)
# Include-Verzeichnisse hinzufügen (falls benötigt)
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Advanced Wars
## Build-Anleitung
### Linux/MacOS
1. Repository klonen:
```bash
git clone https://github.com/username/project.git
cd project
```
2. Build-Verzeichnis erstellen:
```bash
mkdir build && cd build
```
3. CMake konfigurieren und Build ausführen:
```bash
cmake ..
cmake --build .
```
### Windows
1. Repository klonen:
```powershell
git clone https://github.com/username/project.git
cd project
```
2. Build-Verzeichnis erstellen:
```powershell
mkdir build
cd build
```
3. CMake konfigurieren und Build ausführen:
```powershell
cmake ..
cmake --build . --config Release
```
### Visual Studio
1. Repository klonen
2. Visual Studio öffnen
3. "Ordner öffnen" wählen und zum Projektverzeichnis navigieren
4. Visual Studio erkennt automatisch das CMake-Projekt
5. Build über "Build All" ausführen
## Build-Optionen
CMake kann mit verschiedenen Optionen konfiguriert werden:
```bash
cmake .. -DCMAKE_BUILD_TYPE=Release # Release-Build
cmake .. -DCMAKE_BUILD_TYPE=Debug # Debug-Build
```
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment