# libmiracle — the protocol core.
#
# This library must never gain a dependency on Qt or on any I/O facility.
# It is pure data in, pure data out, so that the whole of the IRC wire format
# can be exercised by unit tests without opening a socket. Everything that
# needs a socket or a widget lives in a layer above this one.

add_library(miracle
    src/binary.cpp
    src/casemap.cpp
    src/eventbus.cpp
    src/events.cpp
    src/format.cpp
    src/isupport.cpp
    src/linkify.cpp
    src/message.cpp
    src/network.cpp
    src/palette.cpp
    src/parser.cpp
    src/session.cpp
    src/tags.cpp)

add_library(Miracle::core ALIAS miracle)

# The version header is generated rather than written, so that the number in
# project(VERSION) is the only one anybody edits.
configure_file(include/miracle/version.h.in
               "${CMAKE_CURRENT_BINARY_DIR}/include/miracle/version.h"
               @ONLY)

target_include_directories(miracle PUBLIC include "${CMAKE_CURRENT_BINARY_DIR}/include")
target_link_libraries(miracle PRIVATE miracle_warnings)

set_target_properties(miracle PROPERTIES
    VERSION ${PROJECT_VERSION}
    OUTPUT_NAME miracle)
