set(PACKAGE data_converters-hdf5_pipe)

enable_nls()

message(STATUS ${PACKAGE})

find_package(spdlog REQUIRED)

set(PIPE_NAMES IMDSatToIris KnmiHDF5ToIris iris2odimhdf5)
set(TEST_NAMES TestH5 simplehdf5_test)
set(CONF_FILES IMDSatToIris.conf iris2odimhdf5.conf KnmiHDF5ToIris.conf iris2xml.conf)
set(HDF5_SUPPORT_SOURCES
        HDF5Subs.C
        SigH5Func.C
        SigFunc.C)

link_libraries(hdf5 user-iris)

add_executable(TestH5 TestH5.C SigH5Func.C)
add_executable(simplehdf5_test simplehdf5.cpp)
set_target_properties(simplehdf5_test PROPERTIES COMPILE_FLAGS "-DUNITTEST_BUILD")

link_libraries(pipesup rscan-iris misc-iris dspi-iris himath-iris config-iris antenna-iris exthdr-iris z m popt boost_system tirpc siglog spdlog::spdlog)
        
add_executable(IMDSatToIris IMDSatToIris.C)
add_executable(KnmiHDF5ToIris KnmiHDF5ToIris.C HDF5utils.C Vutils.C)
add_executable(iris2odimhdf5 iris2odimhdf5.C simplehdf5.cpp ${HDF5_SUPPORT_SOURCES})

add_executable(iris2xml iris2xml.cpp simplehdf5.cpp ${HDF5_SUPPORT_SOURCES})
target_link_libraries(iris2xml tinyxml2)

install(TARGETS ${PIPE_NAMES} DESTINATION ${IRIS_PIPES} COMPONENT hdf5)
install(FILES ${CONF_FILES} DESTINATION ${IRIS_CONFIG_TMPL} COMPONENT hdf5)

install(TARGETS iris2xml DESTINATION ${IRIS_PIPES} COMPONENT xml)
install(FILES iris2xml.conf DESTINATION ${IRIS_CONFIG_TMPL} COMPONENT xml)