diff --git a/.gitmodules b/.gitmodules index 9a34671eca..26e90d5cf5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "thirdparty/tclap"] path = thirdparty/tclap/tclap url = https://github.com/xguerin/tclap.git -[submodule "thirdparty/simpleini"] - path = thirdparty/simpleini/simpleini - url = https://github.com/brofield/simpleini.git [submodule "thirdparty/spdlog"] path = thirdparty/spdlog/spdlog url = https://github.com/gabime/spdlog.git diff --git a/CMakeLists.txt b/CMakeLists.txt index cca59846c5..4c5edd431e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -500,7 +500,6 @@ message(STATUS "ECAL_THIRDPARTY_BUILD_HDF5 : ${ECAL_THIRDPAR message(STATUS "ECAL_THIRDPARTY_BUILD_PROTOBUF : ${ECAL_THIRDPARTY_BUILD_PROTOBUF}") message(STATUS "ECAL_THIRDPARTY_BUILD_QWT : ${ECAL_THIRDPARTY_BUILD_QWT}") message(STATUS "ECAL_THIRDPARTY_BUILD_RECYCLE : ${ECAL_THIRDPARTY_BUILD_RECYCLE}") -message(STATUS "ECAL_THIRDPARTY_BUILD_SIMPLEINI : ${ECAL_THIRDPARTY_BUILD_SIMPLEINI}") message(STATUS "ECAL_THIRDPARTY_BUILD_SPDLOG : ${ECAL_THIRDPARTY_BUILD_SPDLOG}") message(STATUS "ECAL_THIRDPARTY_BUILD_TCLAP : ${ECAL_THIRDPARTY_BUILD_TCLAP}") message(STATUS "ECAL_THIRDPARTY_BUILD_TCP_PUBSUB : ${ECAL_THIRDPARTY_BUILD_TCP_PUBSUB}") diff --git a/NOTICE.md b/NOTICE.md index 078e4ec1fb..cec7a4474d 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -248,15 +248,6 @@ recycle - Binary distributions for Windows - Binary distributions for Linux -SimpleIni - - License: MIT - - Project: https://github.com/brofield/simpleini - - Copyright: 2006-2013 Brodie Thiesfield - - Included in: - - Git submodule `/tirdparty/simpleini/simpleini` - - Binary distributions for Windows - - Binary distributions for Linux - spdlog - License: MIT - Project: https://github.com/gabime/spdlog diff --git a/cmake/Modules/Findsimpleini.cmake b/cmake/Modules/Findsimpleini.cmake deleted file mode 100644 index 4954f158fe..0000000000 --- a/cmake/Modules/Findsimpleini.cmake +++ /dev/null @@ -1,24 +0,0 @@ -find_path(simpleini_INCLUDE_DIR - NAMES SimpleIni.h -) - -if(simpleini_INCLUDE_DIR-NOTFOUND) - message(FATAL_ERROR "Could not find simpleini library") - set(simpleini_FOUND FALSE) -else() - set(simpleini_FOUND TRUE) -endif() - -if(simpleini_FOUND) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(simpleini - REQUIRED_VARS simpleini_INCLUDE_DIR) - - if(NOT TARGET simpleini::simpleini) - set(simpleini_INCLUDE_DIRS ${simpleini_INCLUDE_DIR}) - add_library(simpleini::simpleini INTERFACE IMPORTED) - set_target_properties(simpleini::simpleini PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${simpleini_INCLUDE_DIR}) - mark_as_advanced(simpleini_INCLUDE_DIR) - endif() -endif() diff --git a/cmake/submodule_dependencies.cmake b/cmake/submodule_dependencies.cmake index 4dc5952a9e..a0a6726db4 100644 --- a/cmake/submodule_dependencies.cmake +++ b/cmake/submodule_dependencies.cmake @@ -16,7 +16,6 @@ set(ecal_submodule_dependencies Protobuf qwt recycle - simpleini spdlog tclap tcp_pubsub diff --git a/contrib/ecaltime/linuxptp/CMakeLists.txt b/contrib/ecaltime/linuxptp/CMakeLists.txt index 01b1f69898..36f6b43379 100644 --- a/contrib/ecaltime/linuxptp/CMakeLists.txt +++ b/contrib/ecaltime/linuxptp/CMakeLists.txt @@ -18,7 +18,7 @@ project(ecaltime-linuxptp) -find_package(simpleini REQUIRED) +find_package(yaml-cpp REQUIRED) set(ecal_time_linuxptp_src src/ecal_time_linuxptp.cpp @@ -38,7 +38,7 @@ endif() ecal_add_time_plugin(${PROJECT_NAME} SHARED ${ecal_time_linuxptp_src} ${ecal_time_linuxptp_header}) -target_link_libraries(${PROJECT_NAME} eCAL::core simpleini::simpleini) +target_link_libraries(${PROJECT_NAME} eCAL::core yaml-cpp::yaml-cpp) target_include_directories(${PROJECT_NAME} PRIVATE @@ -49,7 +49,7 @@ ecal_install_time_plugin(${PROJECT_NAME}) set(ECALTIME_CONFIG_FILES ${ECALTIME_CONFIG_FILES} - ${CMAKE_CURRENT_SOURCE_DIR}/src/config/ecaltime.ini + ${CMAKE_CURRENT_SOURCE_DIR}/src/config/ecaltime.yaml PARENT_SCOPE) set_target_properties(${PROJECT_NAME} PROPERTIES diff --git a/contrib/ecaltime/linuxptp/src/config/config.h b/contrib/ecaltime/linuxptp/src/config/config.h index 096686bbc0..7063c802a4 100644 --- a/contrib/ecaltime/linuxptp/src/config/config.h +++ b/contrib/ecaltime/linuxptp/src/config/config.h @@ -19,7 +19,7 @@ #pragma once -#include +#include #include #include @@ -32,20 +32,28 @@ namespace LinuxPtpConfig { * @brief reads the file ~/.ecal/ecaltime.ini to get the device * @return the device value from the linuxptp section */ - std::string getDevice() { - CSimpleIniA ini; - + std::string getDevice() { std::string path_to_ini = eCAL::Util::GeteCALConfigPath(); - path_to_ini += "ecaltime.ini"; + path_to_ini += "ecaltime.yaml"; - int err = ini.LoadFile(path_to_ini.c_str()); - if (err != SI_OK){ - std::cerr << "Error reading ecaltime config file" << std::endl; + YAML::Node yaml; + try + { + yaml = YAML::LoadFile(path_to_ini); + } + catch(const std::exception& e) + { + std::cerr << "Error reading ecaltime config file: " << e.what() << "\n"; + } + + if (yaml["linuxptp"]) + { + if (yaml["linuxptp"]["device"]) + { + return yaml["linuxptp"]["device"].as(); + } } - const char * pVal = ini.GetValue("linuxptp", "device", "/dev/ptp0"); - - std::string device(pVal); - return device; + return std::string("/dev/ptp0"); } } diff --git a/contrib/ecaltime/linuxptp/src/config/ecaltime.ini b/contrib/ecaltime/linuxptp/src/config/ecaltime.ini deleted file mode 100644 index 31c0dc00a3..0000000000 --- a/contrib/ecaltime/linuxptp/src/config/ecaltime.ini +++ /dev/null @@ -1,15 +0,0 @@ -; --------------------------------------------- -; ecaltime-linuxptp Settings -; --------------------------------------------- -; -; device = /dev/ptp0 The device can be any ptp clock. -; Alternatively, you can use: -; - CLOCK_MONOTONIC (a steady clock with undefined epoche) -; - CLOCK_REALTIME (the current system time) -; - CLOCK_TAI (Like CLOCK_REALTIME but in International Atomic Time) -; -; --------------------------------------------- -[linuxptp] -device = /dev/ptp0 - - diff --git a/contrib/ecaltime/linuxptp/src/config/ecaltime.yaml b/contrib/ecaltime/linuxptp/src/config/ecaltime.yaml new file mode 100644 index 0000000000..35e841ec16 --- /dev/null +++ b/contrib/ecaltime/linuxptp/src/config/ecaltime.yaml @@ -0,0 +1,13 @@ +# --------------------------------------------- +# ecaltime-linuxptp Settings +# --------------------------------------------- +# +# device = /dev/ptp0 The device can be any ptp clock. +# Alternatively, you can use: +# - CLOCK_MONOTONIC (a steady clock with undefined epoche) +# - CLOCK_REALTIME (the current system time) +# - CLOCK_TAI (Like CLOCK_REALTIME but in International Atomic Time) +# +# --------------------------------------------- +linuxptp: + device: "/dev/ptp0" diff --git a/contrib/ecaltime/linuxptp/src/ecaltime.cpp b/contrib/ecaltime/linuxptp/src/ecaltime.cpp index cc249b87a1..88f46817e5 100644 --- a/contrib/ecaltime/linuxptp/src/ecaltime.cpp +++ b/contrib/ecaltime/linuxptp/src/ecaltime.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "ecal_time_linuxptp.h" #include "config/config.h" diff --git a/doc/rst/development/ecal_cmake_options.rst b/doc/rst/development/ecal_cmake_options.rst index 4100834a91..a477f26f2f 100644 --- a/doc/rst/development/ecal_cmake_options.rst +++ b/doc/rst/development/ecal_cmake_options.rst @@ -71,8 +71,6 @@ All options can be passed on the command line cmake ``-D