# set option
if(CMAKE_VERSION VERSION_LESS "3.1")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
  set(CMAKE_CXX_STANDARD 11)
endif()

if(USES_LIBTORCH)
  set(CXX_STANDARD 14)
  find_package(Torch REQUIRED)
  # target_compile_definitions(${PROJECT_NAME} PRIVATE HARKLIB_USES_LIBTORCH=1)
endif()

include_directories(../include)

add_executable(${PROJECT_NAME}-test-1
    test1.cc
)
target_link_libraries(${PROJECT_NAME}-test-1 hark-lib Eigen3::Eigen "${TORCH_LIBRARIES}")
target_compile_options(${PROJECT_NAME}-test-1 PUBLIC
  $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>
)

add_executable(${PROJECT_NAME}-test-cas
    test-cas.cc
)
target_link_libraries(${PROJECT_NAME}-test-cas hark-lib "${TORCH_LIBRARIES}")
target_compile_options(${PROJECT_NAME}-test-cas PUBLIC
  $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>
)

add_executable(${PROJECT_NAME}-test-semiblindica
    test-semiblindica.cc
)
target_link_libraries(${PROJECT_NAME}-test-semiblindica hark-lib "${TORCH_LIBRARIES}")
target_compile_options(${PROJECT_NAME}-test-semiblindica PUBLIC
  $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>
)
if(USES_LIBTORCH)
add_executable(${PROJECT_NAME}-test-vad-pyannote
    test-vad-pyannote.cc
)
target_link_libraries(${PROJECT_NAME}-test-vad-pyannote hark-lib "${TORCH_LIBRARIES}")
endif()

if(USES_LIBTORCH)
  target_compile_definitions(${PROJECT_NAME}-test-vad-pyannote PRIVATE HARKLIB_USES_LIBTORCH=1)
else()
endif()
target_compile_options(${PROJECT_NAME}-test-vad-pyannote PUBLIC
  $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>
)
