mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
cmake: support build without libconfig
This commit is contained in:
parent
d074ca3683
commit
da64ef5f80
4 changed files with 9 additions and 5 deletions
|
@ -83,4 +83,6 @@ if(TOPLEVEL_PROJECT)
|
|||
message(STATUS " VARIANT: ${CMAKE_PROJECT_VARIANT}")
|
||||
message(STATUS " BUILD_ID: ${CMAKE_PROJECT_BUILD_ID}")
|
||||
message(STATUS " BUILD_DATE: ${CMAKE_PROJECT_BUILD_DATE}")
|
||||
message(STATUS " ARCH: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(STATUS " OS: ${CMAKE_SYSTEM_NAME}")
|
||||
endif()
|
||||
|
|
|
@ -37,7 +37,7 @@ int json_dumpfd(const json_t *json, int output, size_t flags);
|
|||
json_t *json_loadfd(int input, size_t flags, json_error_t *error);
|
||||
#endif
|
||||
|
||||
#if defined(LIBCONFIG_FOUND) && (LIBCONFIG_VER_MAJOR <= 1) && (LIBCONFIG_VER_MINOR < 5)
|
||||
#if defined(WITH_CONFIG) && (LIBCONFIG_VER_MAJOR <= 1) && (LIBCONFIG_VER_MINOR < 5)
|
||||
#include <libconfig.h>
|
||||
|
||||
#define config_setting_lookup config_lookup_from
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
#define PROJECT_NAME "@CMAKE_PROJECT_DESCRIPTION@"
|
||||
#define USER_AGENT "@CMAKE_PROJECT_DESCRIPTION@ (@CMAKE_PROJECT_BUILD_ID@)"
|
||||
|
||||
/* Available Libraries */
|
||||
#cmakedefine LIBCONFIG_FOUND
|
||||
|
||||
/* Paths */
|
||||
#define PREFIX "@CMAKE_INSTALL_PREFIX@"
|
||||
#define PLUGIN_PATH "@CMAKE_INSTALL_PREFIX@/share/villas/node/plugins"
|
||||
|
|
|
@ -77,7 +77,6 @@ target_include_directories(villas-common PUBLIC
|
|||
|
||||
target_link_libraries(villas-common PUBLIC
|
||||
PkgConfig::JANSSON
|
||||
PkgConfig::LIBCONFIG
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
|
@ -86,6 +85,12 @@ target_link_libraries(villas-common PUBLIC
|
|||
stdc++
|
||||
)
|
||||
|
||||
if(WITH_CONFIG)
|
||||
target_link_libraries(villas-common PUBLIC
|
||||
PkgConfig::LIBCONFIG
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(villas-common PUBLIC
|
||||
-D__STDC_FORMAT_MACROS -D_GNU_SOURCE
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue