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

    # Convert pyx to cxx
    add_custom_command(
        OUTPUT ${cxx_src}
        DEPENDS 
            ${CMAKE_CURRENT_SOURCE_DIR}/${h_src}
            ${CMAKE_CURRENT_SOURCE_DIR}/${pyx_src}
        VERBATIM
            COMMAND ${CYTHON}
            --cplus ${CMAKE_CURRENT_SOURCE_DIR}/${pyx_src}
            --output-file ${CMAKE_CURRENT_BINARY_DIR}/${cxx_src})
  
    # Create the python module
    python_add_library(
        ${target_name} MODULE
        ${CMAKE_CURRENT_SOURCE_DIR}/${h_src}
        ${CMAKE_CURRENT_BINARY_DIR}/${cxx_src}
        ${shared_src}
        WITH_SOABI)

    # 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()
