From 15c3f04c5dd510f0dd4a1bd1b6987324ca87a22e Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 5 Apr 2019 22:10:46 +0200 Subject: [PATCH] cmake: more fixes --- CMakeLists.txt | 3 ++- src/villas-hook.cpp | 2 ++ tests/CMakeLists.txt | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 183e5be91..457ecb14d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,7 @@ cmake_dependent_option(WITH_HOOKS "Build with support for processing h cmake_dependent_option(WITH_WEB "Build with internal webserver" ON "LIBWEBSOCKETS_FOUND" OFF) cmake_dependent_option(WITH_API "Build with remote control API" ON "" OFF) cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" ON "LIBCONFIG_FOUND" OFF) -cmake_dependent_option(WITH_SRC "Build villas-* executables" ON "TOPLEVEL_PROJECT" OFF) +cmake_dependent_option(WITH_SRC "Build executables" ON "TOPLEVEL_PROJECT" OFF) cmake_dependent_option(WITH_TOOLS "Build auxilary tools" ON "TOPLEVEL_PROJECT" OFF) cmake_dependent_option(WITH_TESTS "Run tests" ON "TOPLEVEL_PROJECT" OFF) cmake_dependent_option(WITH_PLUGINS "Build plugins" ON "TOPLEVEL_PROJECT" OFF) @@ -197,6 +197,7 @@ add_feature_info(HOOKS WITH_HOOKS "Build with add_feature_info(WEB WITH_WEB "Build with internal webserver") add_feature_info(API WITH_API "Build with remote control API") add_feature_info(CONFIG WITH_CONFIG "Build with support for libconfig configuration syntax") +add_feature_info(SRC WITH_SRC "Build executables") add_feature_info(TOOLS WITH_TOOLS "Build auxilary tools") add_feature_info(TESTS WITH_TESTS "Run tests") add_feature_info(PLUGINS WITH_PLUGINS "Build plugins") diff --git a/src/villas-hook.cpp b/src/villas-hook.cpp index 62ca38ff7..b75f5d4bb 100644 --- a/src/villas-hook.cpp +++ b/src/villas-hook.cpp @@ -69,10 +69,12 @@ static void usage() << " -h show this help" << std::endl << " -V show the version of the tool" << std::endl << std::endl; +#ifdef WITH_HOOKS std::cout << "Supported hooks:" << std::endl; for (Plugin *p : Registry::lookup()) std::cout << " - " << p->getName() << ": " << p->getDescription() << std::endl; std::cout << std::endl; +#endif /* WITH_HOOKS */ std::cout << "Supported IO formats:" << std::endl; plugin_dump(PLUGIN_TYPE_FORMAT); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f533f6a3d..8e5d45fed 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -28,12 +28,14 @@ if(CRITERION_FOUND) add_subdirectory(unit) endif() -set(VALGRIND "valgrind --leak-check=full --show-leak-kinds=all --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/valgrind.supp") +if(WITH_SRC AND WITH_HOOKS) + set(VALGRIND "valgrind --leak-check=full --show-leak-kinds=all --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/valgrind.supp") -add_custom_target(run-valgrind - COMMAND ${VALGRIND} $ & sleep 2; kill %1 - COMMAND ${VALGRIND} $ -t 2 ${PROJECT_SOURCE_DIR}/etc/websocket-loopback.conf ws1 - COMMAND ${VALGRIND} $ mixed -v 4 -l 10 - COMMAND ${VALGRIND} $ stats < <($ mixed -l 5) -) -add_dependencies(run-valgrind villas-node villas-pipe villas-signal villas-hook) + add_custom_target(run-valgrind + COMMAND ${VALGRIND} $ & sleep 2; kill %1 + COMMAND ${VALGRIND} $ -t 2 ${PROJECT_SOURCE_DIR}/etc/websocket-loopback.conf ws1 + COMMAND ${VALGRIND} $ mixed -v 4 -l 10 + COMMAND ${VALGRIND} $ stats < <($ mixed -l 5) + ) + add_dependencies(run-valgrind villas-node villas-pipe villas-signal villas-hook) +endif()