From 48189b1aaaf67c69f6b9c9909657b54423263694 Mon Sep 17 00:00:00 2001 From: Niklas Eiling Date: Fri, 23 Aug 2024 10:08:14 +0200 Subject: [PATCH] protobuf: Install villas.pb-c.h to include/villas/formats Signed-off-by: Niklas Eiling --- include/villas/formats/protobuf.hpp | 2 +- lib/formats/CMakeLists.txt | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/villas/formats/protobuf.hpp b/include/villas/formats/protobuf.hpp index 09048ad72..8ced9b582 100644 --- a/include/villas/formats/protobuf.hpp +++ b/include/villas/formats/protobuf.hpp @@ -12,7 +12,7 @@ #include // Generated message descriptors by protoc -#include +#include namespace villas { namespace node { diff --git a/lib/formats/CMakeLists.txt b/lib/formats/CMakeLists.txt index f50538684..db3477901 100644 --- a/lib/formats/CMakeLists.txt +++ b/lib/formats/CMakeLists.txt @@ -29,6 +29,14 @@ if(DEFINED PROTOBUFC_COMPILER AND PROTOBUFC_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) + add_custom_command( + OUTPUT + ${CMAKE_BINARY_DIR}/include/villas/formats/villas.pb-c.h + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/villas.pb-c.h + ${CMAKE_BINARY_DIR}/include/villas/formats + MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/villas.pb-c.h) + list(APPEND FORMAT_SRC protobuf.cpp ${CMAKE_CURRENT_BINARY_DIR}/villas.pb-c.c @@ -41,15 +49,6 @@ if(DEFINED PROTOBUFC_COMPILER AND PROTOBUFC_FOUND) list(APPEND LIBRARIES PkgConfig::PROTOBUFC ) - - install( - DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/villas - COMPONENT devel - FILES_MATCHING - PATTERN "*.h" - PATTERN "*.hpp" - ) endif() list(APPEND FORMAT_SRC