set(SOURCE config.cpp stat.cpp stellar.cpp inject.cpp)
set(LIBRARY times plugin_manager session_manager ip_reassembly packet_io pthread fieldstat4 toml)

add_library(stellar_core STATIC ${SOURCE})
target_link_libraries(stellar_core ${LIBRARY})

add_library(stellar_devel SHARED ${SOURCE})
target_link_libraries(stellar_devel ${LIBRARY})
set_target_properties(stellar_devel PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/version.map")

add_executable(stellar main.cpp)
target_link_libraries(stellar stellar_core)
target_link_libraries(stellar "-rdynamic")
set_target_properties(stellar PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/version.map")

install(TARGETS stellar RUNTIME DESTINATION bin COMPONENT PROGRAM)
install(TARGETS stellar_devel LIBRARY DESTINATION lib COMPONENT LIBRARIES)