Skip to content

Commit

Permalink
Further runner adaptions. Introduced dumpconfig.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peguen committed Jul 31, 2024
1 parent 49edab7 commit da6d971
Show file tree
Hide file tree
Showing 4 changed files with 267 additions and 238 deletions.
9 changes: 9 additions & 0 deletions ecal/core/cfg/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
eCAL::core
)

# Select the correct ecal config directory on Linux and Windows
if(UNIX)
set(ECAL_SHARED_CONFIG ${eCAL_install_config_dir})
elseif(WIN32)
set(ECAL_SHARED_CONFIG ${eCAL_install_config_dir})
else()
message(STATUS "Unsupported OS, not installing configs")
endif()

# Install the generated YAML file if not cross-compiling
if(ECAL_SHARED_CONFIG AND NOT CMAKE_CROSSCOMPILING)
install(
Expand Down
10 changes: 3 additions & 7 deletions ecal/core/cfg/gen/generate_configuration_yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
int main() {
std::ofstream outFile(ECAL_DEFAULT_CFG);

if (outFile.is_open()) {
auto config_ss = eCAL::Config::getConfigAsYamlSS();
outFile << config_ss.str();
outFile.close();
}
else {
std::cerr << "Error: Could not generate file " << ECAL_DEFAULT_CFG << std::endl;
if (!eCAL::Config::dumpConfigToFile(eCAL::GetConfiguration()))
{
std::cerr << "Failed to write configuration to file: " << ECAL_DEFAULT_CFG << std::endl;
return 1;
}

Expand Down
Loading

0 comments on commit da6d971

Please sign in to comment.