<commit_before>if(WIN32)
    option(OSVR_FPE
        "Enable floating-point exceptions - only works with MSVC and should never be used for shipping code!"
        OFF)
    mark_as_advanced(OSVR_FPE)
endif()

osvr_convert_json(org_osvr_filter_videoimufusion_json
    org_osvr_filter_videoimufusion.json
    "${CMAKE_CURRENT_BINARY_DIR}/org_osvr_filter_videoimufusion_json.h")

# Be able to find our generated header file.
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
set(FUSION_COMMON_SOURCES
    RunningData.h
    RunningData.cpp
    RunningDataPredictCorrect.cpp
    VideoIMUFusion.h
    VideoIMUFusion.cpp)
osvr_add_plugin(NAME org_osvr_filter_videoimufusion
    CPP # indicates we'd like to use the C++ wrapper
    SOURCES
    ${FUSION_COMMON_SOURCES}
    org_osvr_filter_videoimufusion.cpp
    VideoIMUFusionDevice.h
    VideoIMUFusionDevice.cpp
    WrapCallback.h
    "${CMAKE_CURRENT_BINARY_DIR}/org_osvr_filter_videoimufusion_json.h")

target_link_libraries(org_osvr_filter_videoimufusion
    osvr::osvrAnalysisPluginKit
    eigen-headers
    jsoncpp_lib
    osvrKalman)

target_compile_options(org_osvr_filter_videoimufusion
    PRIVATE
    ${OSVR_CXX11_FLAGS})

set_target_properties(org_osvr_filter_videoimufusion PROPERTIES
    FOLDER "OSVR Plugins")
if(BUILD_TESTING)
    add_executable(VideoIMUFusion_Offline
        ${FUSION_COMMON_SOURCES}
        OfflineFusion.cpp)

    target_link_libraries(VideoIMUFusion_Offline
        osvrCommon
        eigen-headers
        jsoncpp_lib
        osvrKalman)

    target_compile_options(VideoIMUFusion_Offline
        PRIVATE
        ${OSVR_CXX11_FLAGS})
    target_compile_definitions(VideoIMUFusion_Offline PRIVATE OSVR_VIDEOIMUFUSION_VERBOSE)
    set_target_properties(VideoIMUFusion_Offline PROPERTIES
        FOLDER "OSVR Plugins")
endif()

if(WIN32 AND OSVR_FPE)
    set(msg_type WARNING)
    if(OSVR_OFFICIAL)
        # set in our CI
        set(msg_type FATAL_ERROR)
    endif()
    message(${msg_type} "OSVR_FPE enabled, will affect the VideoIMUFusion plugin! Do not ship these binaries!")

    target_compile_definitions(org_osvr_filter_videoimufusion PRIVATE OSVR_FPE)
    target_link_libraries(org_osvr_filter_videoimufusion FloatExceptions)<commit_msg>Add offline fusion test to ctest.<commit_after>if(WIN32)
    option(OSVR_FPE
        "Enable floating-point exceptions - only works with MSVC and should never be used for shipping code!"
        OFF)
    mark_as_advanced(OSVR_FPE)
endif()

osvr_convert_json(org_osvr_filter_videoimufusion_json
    org_osvr_filter_videoimufusion.json
    "${CMAKE_CURRENT_BINARY_DIR}/org_osvr_filter_videoimufusion_json.h")

# Be able to find our generated header file.
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
set(FUSION_COMMON_SOURCES
    RunningData.h
    RunningData.cpp
    RunningDataPredictCorrect.cpp
    VideoIMUFusion.h
    VideoIMUFusion.cpp)
osvr_add_plugin(NAME org_osvr_filter_videoimufusion
    CPP # indicates we'd like to use the C++ wrapper
    SOURCES
    ${FUSION_COMMON_SOURCES}
    org_osvr_filter_videoimufusion.cpp
    VideoIMUFusionDevice.h
    VideoIMUFusionDevice.cpp
    WrapCallback.h
    "${CMAKE_CURRENT_BINARY_DIR}/org_osvr_filter_videoimufusion_json.h")

target_link_libraries(org_osvr_filter_videoimufusion
    osvr::osvrAnalysisPluginKit
    eigen-headers
    jsoncpp_lib
    osvrKalman)

target_compile_options(org_osvr_filter_videoimufusion
    PRIVATE
    ${OSVR_CXX11_FLAGS})

set_target_properties(org_osvr_filter_videoimufusion PROPERTIES
    FOLDER "OSVR Plugins")
if(BUILD_TESTING)
    add_executable(VideoIMUFusion_Offline
        ${FUSION_COMMON_SOURCES}
        OfflineFusion.cpp)

    target_link_libraries(VideoIMUFusion_Offline
        osvrCommon
        eigen-headers
        jsoncpp_lib
        osvrKalman)

    target_compile_options(VideoIMUFusion_Offline
        PRIVATE
        ${OSVR_CXX11_FLAGS})
    target_compile_definitions(VideoIMUFusion_Offline PRIVATE OSVR_VIDEOIMUFUSION_VERBOSE)
    set_target_properties(VideoIMUFusion_Offline PROPERTIES
        FOLDER "OSVR Plugins")
    add_test(NAME VideoIMUFusion_Offline_NearOnDesk
        COMMAND VideoIMUFusion_Offline "${CMAKE_CURRENT_SOURCE_DIR}/near-on-desk.json")
endif()

if(WIN32 AND OSVR_FPE)
    set(msg_type WARNING)
    if(OSVR_OFFICIAL)
        # set in our CI
        set(msg_type FATAL_ERROR)
    endif()
    message(${msg_type} "OSVR_FPE enabled, will affect the VideoIMUFusion plugin! Do not ship these binaries!")

    target_compile_definitions(org_osvr_filter_videoimufusion PRIVATE OSVR_FPE)
    target_link_libraries(org_osvr_filter_videoimufusion FloatExceptions)
{'fraction_non_alphanumeric': 0.05683297180043384, 'fraction_numerical': 0.0034707158351409977, 'mean_word_length': 4.609489051094891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4723533', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1616, 'n_words': 251}