set(PACKAGE base-sws_lib)

message(STATUS ${PACKAGE})

set(LIB_NAME sws-iris)
set(SOURCE_FILES
        bulletin.cpp
        bulletin.hpp
        clouds.hpp
        message_parser.hpp
        metar_parser.cpp
        metar_parser.hpp
        metar_tokens.hpp
        report.cpp
        report.hpp
        station.cpp
        station.hpp
        str2val.hpp
        sws.hpp
        synop_parser.cpp
        synop_parser.hpp
        weather.hpp)
file(GLOB INST_INCLUDES "*.hpp")

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../misc_lib
  ${CMAKE_CURRENT_SOURCE_DIR}/../himath_lib
  ${CMAKE_CURRENT_SOURCE_DIR}/../user_lib)


add_library(${LIB_NAME} SHARED ${SOURCE_FILES})
set(LIB_MAJOR_VER 10) # Set Library major version, this is also used for SO file versioning
set(LIB_MINOR_VER 0) # Set Library minor version
set(LIB_PATCH_VER 0) # Set Library patch version
set(LIB_VERSION "${LIB_MAJOR_VER}.${LIB_MINOR_VER}.${LIB_PATCH_VER}")
set_target_properties(${LIB_NAME} PROPERTIES VERSION ${LIB_VERSION} SOVERSION ${LIB_MAJOR_VER})

add_executable(test_sws test_sws.cpp)
target_link_libraries(test_sws
        sws-iris misc-iris dsp-iris antenna-iris config-iris exthdr-iris dl himath-iris user-iris tirpc stdc++ boost_filesystem
        boost_unit_test_framework boost_regex boost_date_time m z)

install(
  TARGETS ${LIB_NAME}
  DESTINATION ${IRIS_LIB}
  LIBRARY COMPONENT libs NAMELINK_COMPONENT libs-devel)

install(
  FILES ${INST_INCLUDES}
  DESTINATION ${IRIS_INCLUDE}
  COMPONENT libs-devel)
