Implements bidirectional conversion between KOReader XPath positions and FreeInkBook character offsets. Uses streaming SAX parsing to match chapter text accounting with ChapterLayout, enabling position sync without requiring DOM or pagination. Handles element ancestry tracking, text offset calculation, and spine index extraction.
48 lines
1.1 KiB
CMake
48 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(crosspoint_reader_tests CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
endif()
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
googletest
|
|
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
GIT_TAG v1.17.0
|
|
)
|
|
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
|
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
set(REPO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
|
|
add_library(crosspoint_test_common INTERFACE)
|
|
target_include_directories(crosspoint_test_common INTERFACE
|
|
${REPO_ROOT}
|
|
${REPO_ROOT}/lib
|
|
)
|
|
target_compile_options(crosspoint_test_common INTERFACE
|
|
-Wall
|
|
-Wextra
|
|
-pedantic
|
|
)
|
|
|
|
enable_testing()
|
|
include(GoogleTest)
|
|
|
|
add_subdirectory(streaming_json_parser)
|
|
add_subdirectory(release_json_parser)
|
|
add_subdirectory(differential_rounding)
|
|
add_subdirectory(hyphenation_eval)
|
|
add_subdirectory(utf8_compose)
|
|
add_subdirectory(cpfont_adapter)
|
|
add_subdirectory(book_xpath)
|