We present an exact derivation of the free energy functional of a fluid mixture of hard rods with arbitrary sizes on a one-dimensional lattice. Our approach is based on the Wertheim cluster theory which consists of mapping a system with finite range interactions to the system with pure hard-core interaction but with modified activities. We show that the free energy functional has the same form as the fundamental measure functional. The interactions part of the free energy has two contributions, one from the one-particle cavity restricted to the hard rod or hard-sphere diameter and a second from the two-particle cavity which includes the finite range of the interaction. In the limit of a one-component system, our results reduce to the one derived using the Markov chain approach. For vanishing interactions, the density functionals coincide exactly with the previously derived for the mixture of hard rods with pure hard-core interaction.