cmake_minimum_required(VERSION 3.20)
project(HanIMECompositionConsumer LANGUAGES CXX)
set(CMAKE_CXX_EXTENSIONS OFF)
set(HANIME_ROOT "" CACHE PATH "HanIME public source API 0.8.0/0.9.0 root")
if(NOT EXISTS "${HANIME_ROOT}/include/hanime/composition_commit.hpp")
  message(FATAL_ERROR "Pass -DHANIME_ROOT=/absolute/path/to/HANIME_Independent_Core")
endif()
set(HANIME_BUILD_HOST_ADAPTERS ON CACHE BOOL "" FORCE)
set(HANIME_BUILD_FIXTURES OFF CACHE BOOL "" FORCE)
set(HANIME_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(HANIME_BUILD_TESTS OFF CACHE BOOL "" FORCE)
add_subdirectory("${HANIME_ROOT}" hanime)
get_target_property(hanime_version hanime_core VERSION)
if(NOT hanime_version VERSION_EQUAL "0.8.0" AND NOT hanime_version VERSION_EQUAL "0.9.0" AND NOT hanime_version VERSION_EQUAL "0.10.0" AND NOT hanime_version VERSION_EQUAL "0.10.1" AND NOT hanime_version VERSION_EQUAL "0.11.0" AND NOT hanime_version VERSION_EQUAL "0.12.0")
  message(FATAL_ERROR "This consumer requires source API 0.8.0 through 0.12.0")
endif()
add_executable(hanime_composition_consumer main.cpp)
target_link_libraries(hanime_composition_consumer PRIVATE HanIME::Host)
target_compile_options(hanime_composition_consumer PRIVATE -Wall -Wextra -Wpedantic -Werror -fstack-usage)
target_compile_features(hanime_composition_consumer PRIVATE cxx_std_17)
