list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(UseCython)

function(tbp_add_pyx suffix)
    set(target_name "interface_${suffix}")
    set(h_src "${target_name}.h")
    set(pyx_src "${target_name}.pyx")
    set(shared_src parser.h pymodel.h)

    # tells UseCython to compile this file as a c++ file
    set_source_files_properties(${pyx_src} PROPERTIES CYTHON_IS_CXX TRUE)

    # create python module
    cython_add_module(${target_name} ${h_src} ${pyx_src} ${shared_src})

    # Dependencies
    target_include_directories(${target_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
    target_link_directories(${target_name} PUBLIC ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    target_link_libraries(${target_name} PUBLIC tbplas)
endfunction()
