
if(NOT UNIX OR MACOS)
    message(FATAL_ERROR "This program available only for Unix/Linux!")
endif()

find_package(X11 REQUIRED)

set(SRC_LIST
    fb2v.cpp
    xutils.cpp
)

file(COPY "${CMAKE_SOURCE_DIR}/crengine/data/css/fb2.css" DESTINATION ${CMAKE_CURRENT_BINARY_DIR} USE_SOURCE_PERMISSIONS)
file(COPY example.fb2 DESTINATION ${CMAKE_CURRENT_BINARY_DIR} USE_SOURCE_PERMISSIONS)
file(COPY "${CMAKE_SOURCE_DIR}/crengine/data/hyph/hyph-ru-ru,en-us.pattern" DESTINATION ${CMAKE_CURRENT_BINARY_DIR} USE_SOURCE_PERMISSIONS)

add_executable(fb2view ${SRC_LIST})
target_link_libraries(fb2view PUBLIC ${PUBLIC_LINK_LIBRARIES} PRIVATE crengine-ng X11::X11)
