Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
langchr86 committed Feb 7, 2024
1 parent bc184c6 commit e7d71fd
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 49 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/cmake-exercise/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Jumpstart CMake exercise",
"image": "danger89/cmake:5.0",
"customizations": {
"vscode": {
"extensions": [
"llvm-vs-code-extensions.vscode-clangd",
"matepek.vscode-catch2-test-adapter",
"ms-vscode.cmake-tools",
"twxs.cmake"
],
"settings": {
"cmake.sourceDirectory": "${workspaceFolder}/topics/build_systems/code"
}
}
}
}
14 changes: 0 additions & 14 deletions .devcontainer/cmake/devcontainer.json

This file was deleted.

16 changes: 16 additions & 0 deletions .devcontainer/docmake/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Jumpstart docmake",
"image": "ghcr.io/langchr86/docmake@sha256:32d37fb9a637f0bd2b7860305a31e29ceb665f5f8f884b463a1da4d74cbf308d",
"customizations": {
"vscode": {
"extensions": [
"mathematic.vscode-pdf",
"llvm-vs-code-extensions.vscode-clangd",
"matepek.vscode-catch2-test-adapter",
"ms-vscode.cmake-tools",
"twxs.cmake"
],
"postStartCommand": "Xvfb :99 &"
}
}
}
2 changes: 2 additions & 0 deletions .github/workflows/cmake-exercise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- name: configure and build
working-directory: topics/build_systems/code
run: |
rm CMakeLists.txt
mv CMakeLists_solution.txt CMakeLists.txt
mkdir build
cmake -S . -B build
cmake --build build
Expand Down
11 changes: 11 additions & 0 deletions topics/admin/codespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<#include meta/slides.md>

---
title: "Jumpstart - Codespaces"
---


Entwicklungsumgebungen
----------------------

Bla
2 changes: 1 addition & 1 deletion topics/build_systems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ js_exercise(build_systems_exercise build_systems_exercise.md)
js_script(bitbucket_pipelines_exercise bitbucket_pipelines_exercise.md)

file(GLOB_RECURSE code RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "code/*")
list(FILTER code EXCLUDE REGEX "code/CMakeLists.txt")
list(FILTER code EXCLUDE REGEX "code/CMakeLists_solution.txt")
js_add_to_global_archive_file_list(${code})

if (JS_WITH_CODE)
Expand Down
6 changes: 2 additions & 4 deletions topics/build_systems/build_systems_exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ Der typische Workflow, um ein CMake-basiertes Projekt zu kompilieren, sieht folg
Aufgabe
-------

* Die Vorlage für die CMake-Konfiguration: `CMakeLists_exercise.txt` im entpackten `code`-Ordner
zu `CMakeLists.txt` umbenennen
und mit CLion dieses CMake-Projekt (`code`-Ordner) öffnen.
Dies sollte automatisch den CMake-Cache erzeugen.
* Mit CLion das vorbereitete CMake-Projekt (`code`-Ordner) öffnen.
Dadurch sollte das `CMakeLists.txt` im entpackten `code`-Ordner automatisch geladen und der CMake-Cache erzeugt werden.
* Das `CMakeLists.txt` so vervollständigen,
dass die Hauptapplikation gebaut werden kann.
Die Dokumentation zu folgenden Befehlen könnte helfen: `set`, `target_include_directories`, `add_executable`
Expand Down
21 changes: 0 additions & 21 deletions topics/build_systems/code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,4 @@ cmake_minimum_required(VERSION 3.5)
project(bit_fields)
set(BF_TARGET bit-fields)

# search all relevant files
file(GLOB_RECURSE BF_SRC_MAIN "src/main.c*")
file(GLOB_RECURSE BF_SRC_ALL "src/*.c*")
file(GLOB_RECURSE BF_TEST_ALL "test/*.c*")
list(REMOVE_ITEM BF_SRC_ALL ${BF_SRC_MAIN})

# internal library target
set(BF_TARGET_LIB ${BF_TARGET}-lib)
add_library(${BF_TARGET_LIB} STATIC ${BF_SRC_ALL})
target_include_directories(${BF_TARGET_LIB} PUBLIC "libs" "src")

# main app target
set(BF_TARGET_APP ${BF_TARGET}-app)
add_executable(${BF_TARGET_APP} ${BF_SRC_MAIN})
target_link_libraries(${BF_TARGET_APP} PRIVATE ${BF_TARGET_LIB})

# unit test target
set(BF_TARGET_TEST ${BF_TARGET}-test)
enable_testing()
add_executable(${BF_TARGET_TEST} ${BF_TEST_ALL})
add_test(unittest ${BF_TARGET_TEST})
target_link_libraries(${BF_TARGET_TEST} PRIVATE ${BF_TARGET_LIB})
7 changes: 0 additions & 7 deletions topics/build_systems/code/CMakeLists_exercise.txt

This file was deleted.

28 changes: 28 additions & 0 deletions topics/build_systems/code/CMakeLists_solution.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.5)

# project settings
project(bit_fields)
set(BF_TARGET bit-fields)

# search all relevant files
file(GLOB_RECURSE BF_SRC_MAIN "src/main.c*")
file(GLOB_RECURSE BF_SRC_ALL "src/*.c*")
file(GLOB_RECURSE BF_TEST_ALL "test/*.c*")
list(REMOVE_ITEM BF_SRC_ALL ${BF_SRC_MAIN})

# internal library target
set(BF_TARGET_LIB ${BF_TARGET}-lib)
add_library(${BF_TARGET_LIB} STATIC ${BF_SRC_ALL})
target_include_directories(${BF_TARGET_LIB} PUBLIC "libs" "src")

# main app target
set(BF_TARGET_APP ${BF_TARGET}-app)
add_executable(${BF_TARGET_APP} ${BF_SRC_MAIN})
target_link_libraries(${BF_TARGET_APP} PRIVATE ${BF_TARGET_LIB})

# unit test target
set(BF_TARGET_TEST ${BF_TARGET}-test)
enable_testing()
add_executable(${BF_TARGET_TEST} ${BF_TEST_ALL})
add_test(unittest ${BF_TARGET_TEST})
target_link_libraries(${BF_TARGET_TEST} PRIVATE ${BF_TARGET_LIB})
4 changes: 2 additions & 2 deletions topics/docker/slides/practice_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Interactive Tutorials

Freier Playground: [play_with_docker_playground]

Wenn der Playground nicht geeignet ist,
kann die Docker-Installation in der *jumpstart-vm* verwendet werden.
Wenn der Playground nicht zuverlässig läuft,
kann in github eine Codespaces-Instanz mit "Default project Configuration" verwendet werden.

0 comments on commit e7d71fd

Please sign in to comment.