We have used the density functional theory to study the effect of molecular elongation on the isotropic-nematic, isotropic-smectic A and nematic-smectic A phase transitions of a fluid of molecules interacting via the Gay-Berne intermolecular potential. We have considered a range of length-to-width parameter 3.0 < or = x(0) < or = 4.0 in steps of 0.2 at different densities and temperatures. Pair correlation functions needed as input information in density functional theory are calculated using the Percus-Yevick integral equation theory. Within the small range of elongation, the phase diagram shows significant changes. The fluid at low temperature is found to freeze directly from isotropic to smectic A phase for all the values of x(0) considered by us on increasing the density while the nematic phase stabilizes in between isotropic and smectic A phases only at high temperatures and densities. Both isotropic-nematic and nematic-smectic A transition density and pressure are found to decrease as we increase x(0). The phase diagram obtained is compared with computer simulation result of the same model potential and is found to be in good qualitative agreement.