From: Bastian Dehn Date: Thu, 20 Jun 2024 15:50:12 +0000 (+0200) Subject: change compile soll hours and minutes X-Git-Tag: 1.1.0^2~2^2~5 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=03477d18f7f001274ff6e05d4d108b0680ca8e7a;p=feierabend.git change compile soll hours and minutes --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b00d864..0b4b196 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1) PROJECT(feierabend VERSION 1.0.1) +SET(SOLL_HOUR 8 CACHE STRING "soll Stunden") +SET(SOLL_MINUTES 0 CACHE STRING "soll Minuten") + CONFIGURE_FILE(config.h.in config.h) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/config.h.in b/src/config.h.in index 4f67b14..1a8212b 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -1 +1,3 @@ -#define PROJECT_VERSION "@PROJECT_VERSION@" \ No newline at end of file +#define PROJECT_VERSION "@PROJECT_VERSION@" +#define SOLL_HOUR @SOLL_HOUR@ +#define SOLL_MINUTES @SOLL_MINUTES@ \ No newline at end of file diff --git a/src/worktime.c b/src/worktime.c index 07dad9d..2b4a8aa 100644 --- a/src/worktime.c +++ b/src/worktime.c @@ -1,7 +1,8 @@ #include "worktime.h" #include "break.h" +#include "config.h" -#define EIGHT_HOURS 28800 +#define EIGHT_HOURS SOLL_HOUR * 3600 + SOLL_MINUTES * 60 #define TEN_HOURS 36000 time_t get_brutto_worktime(time_t begin, time_t now) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4bbeaf9..77f6315 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,6 +2,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1) FIND_LIBRARY(CMOCKA cmocka REQUIRED) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src) + ADD_EXECUTABLE(break_tests break_tests.c ../src/break.c)