1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

introduce new PORJECT_* macros

This commit is contained in:
Steffen Vogel 2018-08-22 11:30:52 +02:00
parent 7ef001afa8
commit af2a11b28c
5 changed files with 18 additions and 7 deletions

View file

@ -22,7 +22,10 @@
cmake_minimum_required(VERSION 3.7) 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_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") 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(lib)
add_subdirectory(tests) add_subdirectory(tests)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/villas/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/villas/config.h
)

View file

@ -30,6 +30,9 @@
#define V 2 #define V 2
#endif #endif
#define PROJECT_URL "@CMAKE_PROJECT_HOMEPAGE_URL@"
#define PROJECT_NAME "@CMAKE_PROJECT_DESCRIPTION@"
/* Paths */ /* Paths */
#define PLUGIN_PATH PREFIX "/share/villas/node/plugins" #define PLUGIN_PATH PREFIX "/share/villas/node/plugins"
#define WEB_PATH PREFIX "/share/villas/node/web" #define WEB_PATH PREFIX "/share/villas/node/web"
@ -55,7 +58,7 @@
#define IPPROTO_VILLAS 137 #define IPPROTO_VILLAS 137
#define ETH_P_VILLAS 0xBABE #define ETH_P_VILLAS 0xBABE
#define USER_AGENT "VILLASfpga (" BUILDID ")" #define USER_AGENT PROJECT_NAME " (" BUILDID ")"
/* Required kernel version */ /* Required kernel version */
#define KERNEL_VERSION_MAJ 3 #define KERNEL_VERSION_MAJ 3

View file

@ -46,12 +46,12 @@ int rt_init(int priority, int affinity)
if (priority) if (priority)
rt_set_priority(priority); rt_set_priority(priority);
else 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) if (affinity)
rt_set_affinity(affinity); rt_set_affinity(affinity);
else 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(); rt_lock_memory();
#else #else
@ -89,7 +89,7 @@ int rt_set_affinity(int affinity)
is_isol = kernel_get_cmdline_param("isolcpus", isolcpus, sizeof(isolcpus)); is_isol = kernel_get_cmdline_param("isolcpus", isolcpus, sizeof(isolcpus));
if (is_isol) { 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); CPU_ZERO(&cset_isol);
} }

View file

@ -292,7 +292,7 @@ void log_vprint(struct log *l, const char *lvl, const char *fmt, va_list ap)
/* Output */ /* Output */
#ifdef ENABLE_OPAL_ASYNC #ifdef ENABLE_OPAL_ASYNC
OpalPrint("VILLASnode: %s\n", buf); OpalPrint(PROJECT_NAME ": %s\n", buf);
#endif #endif
if (l->file) { if (l->file) {
if (l->tty == false) if (l->tty == false)

View file

@ -38,7 +38,7 @@ pthread_t main_thread;
void print_copyright() 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__)); CLR_BLU(BUILDID), CLR_MAG(__DATE__), CLR_MAG(__TIME__));
printf(" Copyright 2014-2017, Institute for Automation of Complex Power Systems, EONERC\n"); printf(" Copyright 2014-2017, Institute for Automation of Complex Power Systems, EONERC\n");
printf(" Steffen Vogel <StVogel@eonerc.rwth-aachen.de>\n"); printf(" Steffen Vogel <StVogel@eonerc.rwth-aachen.de>\n");