diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 6fa5c6dee..2d63ed8ad 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -22,7 +22,10 @@ cmake_minimum_required(VERSION 3.7) -project(villas-common CXX) +project(villas-common + DESCRIPTION "VILLAScommon" + LANGUAGES C CXX +) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") @@ -42,3 +45,8 @@ pkg_check_modules(JANSSON IMPORTED_TARGET jansson) add_subdirectory(lib) add_subdirectory(tests) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/include/villas/config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/villas/config.h +) diff --git a/common/include/villas/config.h b/common/include/villas/config.h.in similarity index 92% rename from common/include/villas/config.h rename to common/include/villas/config.h.in index 9254429d8..ffe6d3303 100644 --- a/common/include/villas/config.h +++ b/common/include/villas/config.h.in @@ -30,6 +30,9 @@ #define V 2 #endif +#define PROJECT_URL "@CMAKE_PROJECT_HOMEPAGE_URL@" +#define PROJECT_NAME "@CMAKE_PROJECT_DESCRIPTION@" + /* Paths */ #define PLUGIN_PATH PREFIX "/share/villas/node/plugins" #define WEB_PATH PREFIX "/share/villas/node/web" @@ -55,7 +58,7 @@ #define IPPROTO_VILLAS 137 #define ETH_P_VILLAS 0xBABE -#define USER_AGENT "VILLASfpga (" BUILDID ")" +#define USER_AGENT PROJECT_NAME " (" BUILDID ")" /* Required kernel version */ #define KERNEL_VERSION_MAJ 3 diff --git a/common/lib/kernel/rt.c b/common/lib/kernel/rt.c index 01180f297..f72657adc 100644 --- a/common/lib/kernel/rt.c +++ b/common/lib/kernel/rt.c @@ -46,12 +46,12 @@ int rt_init(int priority, int affinity) if (priority) rt_set_priority(priority); else - warn("You might want to use the 'priority' setting to increase VILLASnode's process priority"); + warn("You might want to use the 'priority' setting to increase " PROJECT_NAME "'s process priority"); if (affinity) rt_set_affinity(affinity); else - warn("You might want to use the 'affinity' setting to pin VILLASnode to dedicate CPU cores"); + warn("You might want to use the 'affinity' setting to pin " PROJECT_NAME " to dedicate CPU cores"); rt_lock_memory(); #else @@ -89,7 +89,7 @@ int rt_set_affinity(int affinity) is_isol = kernel_get_cmdline_param("isolcpus", isolcpus, sizeof(isolcpus)); if (is_isol) { - warn("You should reserve some cores for VILLASnode (see 'isolcpus')"); + warn("You should reserve some cores for " PROJECT_NAME " (see 'isolcpus')"); CPU_ZERO(&cset_isol); } diff --git a/common/lib/log.c b/common/lib/log.c index ad3d2c694..d35d101e1 100644 --- a/common/lib/log.c +++ b/common/lib/log.c @@ -292,7 +292,7 @@ void log_vprint(struct log *l, const char *lvl, const char *fmt, va_list ap) /* Output */ #ifdef ENABLE_OPAL_ASYNC - OpalPrint("VILLASnode: %s\n", buf); + OpalPrint(PROJECT_NAME ": %s\n", buf); #endif if (l->file) { if (l->tty == false) diff --git a/common/lib/utils.c b/common/lib/utils.c index 9ce0dff03..50c1bf9d0 100644 --- a/common/lib/utils.c +++ b/common/lib/utils.c @@ -38,7 +38,7 @@ pthread_t main_thread; void print_copyright() { - printf("VILLASfpga %s (built on %s %s)\n", + printf(PROJECT_NAME " %s (built on %s %s)\n", CLR_BLU(BUILDID), CLR_MAG(__DATE__), CLR_MAG(__TIME__)); printf(" Copyright 2014-2017, Institute for Automation of Complex Power Systems, EONERC\n"); printf(" Steffen Vogel \n");