Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[config] configuration yaml generation #1680

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@ jobs:
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \
-DECAL_THIRDPARTY_BUILD_QWT=ON \
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr/local/opt/[email protected] \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
-DPython_FIND_STRATEGY=LOCATION \
-DPython_FIND_REGISTRY=NEVER
sudo mkdir /etc/ecal
sudo cp "$GITHUB_WORKSPACE/ecal/core/cfg/ecal.yaml" /etc/ecal
sudo cp "./ecal/core/cfg/gen/ecal.yaml" /etc/ecal
shell: bash

- name: Build Release
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ jobs:
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \
-DECAL_THIRDPARTY_BUILD_QWT=ON \
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
Expand All @@ -144,7 +143,7 @@ jobs:
-DPython_FIND_VIRTUALENV=ONLY

sudo mkdir /etc/ecal
sudo cp "$GITHUB_WORKSPACE/ecal/core/cfg/ecal.yaml" /etc/ecal
sudo cp "./ecal/core/cfg/gen/ecal.yaml" /etc/ecal
shell: bash

- name: Build Release
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON ^
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON ^
-DECAL_THIRDPARTY_BUILD_QWT=OFF ^
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON ^
-DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_PREFIX_PATH="%ProgramFiles%/Cap'n Proto/lib/cmake/CapnProto" ^
Expand Down Expand Up @@ -131,14 +130,13 @@ jobs:
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON ^
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON ^
-DECAL_THIRDPARTY_BUILD_QWT=ON ^
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON ^
-DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_PREFIX_PATH="%ProgramFiles%/Cap'n Proto/lib/cmake/CapnProto" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCPACK_PACK_WITH_INNOSETUP=ON
mkdir "%ALLUSERSPROFILE%\eCAL"
copy "%GITHUB_WORKSPACE%\ecal\core\cfg\ecal.yaml" "%ALLUSERSPROFILE%\eCAL"
copy ".\ecal\core\cfg\gen\ecal.yaml" "%ALLUSERSPROFILE%\eCAL"
shell: cmd

- name: Build SDK
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \
-DECAL_THIRDPARTY_BUILD_QWT=OFF \
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \
-DECAL_THIRDPARTY_BUILD_QWT=OFF \
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ option(ECAL_USE_CLOCKLOCK_MUTEX "Use native mutex with monotonic
set(ECAL_CORE_HAS_PROTOBUF ON)
set(ECAL_CORE_BUILD_SAMPLES ${BUILD_SAMPLES})
set(ECAL_CORE_BUILD_TESTS ${BUILD_ECAL_TESTS})
set(ECAL_CORE_CONFIGURATION ON)
option(ECAL_CORE_CONFIGURATION ON)
Peguen marked this conversation as resolved.
Show resolved Hide resolved
set(ECAL_CORE_COMMAND_LINE ON)
set(ECAL_CORE_REGISTRATION ON)
set(ECAL_CORE_MONITORING ON)
Expand All @@ -117,6 +117,11 @@ set(ECAL_CORE_TRANSPORT_UDP
set(ECAL_CORE_TRANSPORT_TCP ON)
set(ECAL_CORE_TRANSPORT_SHM ON)

# Configuration depends on yaml-cpp
if(ECAL_CORE_CONFIGURATION)
set(ECAL_THIRDPARTY_BUILD_YAML-CPP ON)
endif()

# This should be ON, unless build ecal hdf5 for Matlab usage
option(ECAL_LINK_HDF5_SHARED "Link shared libs of HDF5" ON)

Expand Down
3 changes: 1 addition & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
"HAS_FTXUI": "OFF",
"BUILD_APPS": "OFF",
"BUILD_SAMPLES": "OFF",
"ECAL_CORE_CONFIGURATION": "OFF",
"ECAL_INSTALL_SAMPLE_SOURCES": "OFF",
"ECAL_THIRDPARTY_BUILD_FINEFTP": "OFF",
"ECAL_THIRDPARTY_BUILD_FTXUI": "OFF",
"ECAL_THIRDPARTY_BUILD_SPDLOG": "OFF",
"ECAL_THIRDPARTY_BUILD_TERMCOLOR": "OFF",
"ECAL_THIRDPARTY_BUILD_TINYXML2": "OFF",
"ECAL_THIRDPARTY_BUILD_YAML-CPP": "ON",
"ECAL_THIRDPARTY_BUILD_CURL": "OFF",
"ECAL_THIRDPARTY_BUILD_HDF5": "OFF"
}
Expand Down Expand Up @@ -98,7 +98,6 @@
"ECAL_THIRDPARTY_BUILD_SPDLOG": "ON",
"ECAL_THIRDPARTY_BUILD_TERMCOLOR": "ON",
"ECAL_THIRDPARTY_BUILD_TINYXML2": "ON",
"ECAL_THIRDPARTY_BUILD_YAML-CPP": "ON",
"ECAL_THIRDPARTY_BUILD_CURL": null,
"ECAL_THIRDPARTY_BUILD_HDF5": null
}
Expand Down
2 changes: 0 additions & 2 deletions build_win/win_make_cmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ set CMAKE_OPTIONS_COMPLETE=-DCMAKE_INSTALL_PREFIX=_install ^
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON ^
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON ^
-DECAL_THIRDPARTY_BUILD_QWT=ON ^
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON ^
-DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
Expand Down Expand Up @@ -66,7 +65,6 @@ set CMAKE_OPTIONS_SDK=-DCMAKE_INSTALL_PREFIX=_install ^
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON ^
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON ^
-DECAL_THIRDPARTY_BUILD_QWT=OFF ^
-DECAL_THIRDPARTY_BUILD_YAML-CPP=ON ^
-DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Debug ^
Expand Down
1 change: 1 addition & 0 deletions ecal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ endif()
# core config
# --------------------------------------------------------
add_subdirectory(core/cfg)
add_subdirectory(core/cfg/gen)

# --------------------------------------------------------
# services
Expand Down
17 changes: 11 additions & 6 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ endif()
# config
######################################
set(ecal_config_src
src/config/configuration_reader.cpp
src/config/configuration_to_yaml.cpp
src/config/default_configuration.cpp
src/config/ecal_cmd_parser.cpp
src/config/ecal_config.cpp
src/config/ecal_config_initializer.cpp
src/types/ecal_custom_data_types.cpp
src/pubsub/ecal_publisher_config.cpp
src/pubsub/ecal_subscriber_config.cpp
src/types/ecal_custom_data_types.cpp
)

if (ECAL_CORE_CONFIGURATION)
list(APPEND ecal_config_src
src/config/configuration_to_yaml.cpp
src/config/configuration_reader.cpp
)
endif()
######################################
# io/mtx
######################################
Expand Down Expand Up @@ -566,6 +567,10 @@ ecal_add_ecal_shared_library(${PROJECT_NAME}
${CMAKE_CURRENT_BINARY_DIR}/include/ecal/ecal_defs.h
)

if (ECAL_CORE_CONFIGURATION)
target_compile_definitions(${PROJECT_NAME} PRIVATE ECAL_CORE_CONFIGURATION)
endif()

if(UNIX)
set_source_files_properties(src/util/convert_utf.cpp PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough)
endif()
Expand Down
16 changes: 1 addition & 15 deletions ecal/core/cfg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ========================= eCAL LICENSE =================================
#
# Copyright (C) 2016 - 2019 Continental Corporation
# Copyright (C) 2016 - 2024 Continental Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,6 @@
#
# ========================= eCAL LICENSE =================================

set(ECAL_YAML "ecal.yaml")
set(ECALTIME_INI "ecaltime.ini")

# Merge all ecaltime config files
Expand All @@ -27,8 +26,6 @@ foreach(ECALTIME_CONFIG ${ECALTIME_CONFIG_FILES})
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${ECALTIME_INI} "${CONTENTS}")
endforeach()



# Select the correct ecal config directory on Linux and Windows
if(UNIX)
set(ECAL_SHARED_CONFIG ${eCAL_install_config_dir})
Expand All @@ -38,20 +35,9 @@ else()
message(STATUS "Unsupported OS, not installing configs")
endif()

configure_file(
${ECAL_YAML}
${ECAL_YAML}
)

# Install the configs
if(ECAL_SHARED_CONFIG AND NOT CMAKE_CROSSCOMPILING)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${ECAL_YAML}
DESTINATION
${ECAL_SHARED_CONFIG}
COMPONENT configuration
)
if(BUILD_TIME)
install(
FILES
Expand Down
Loading
Loading