It's worth noting that taking the weapon proficiency feat is generally not worth it, aside from aesthetic purposes.
Martial classes will already be proficient with the weapons they would be best with, so the only ones taking this will generally be spellcasters. Spellcasters will be better off increasing their ability to spellcast, but for the sake of explaining my point, I'll pretend that you want to use weapons with your spellcaster.

Here's the math on it:
Let's take a Lv4 wizard with a 16 DEX(+3) who can only wield a dagger(1d4) proficiently.

They will have a +5 to hit(3(DEX)+2(Prof.)) and deal 1d4+3(DEX), for
4-7 damage, or an average of 5.5 damage per hit.

At Lvl4, they can choose to take the feat for weapon proficiency or boost their DEX to +4.

Choosing the feat to become proficient in rapiers and longbows, they now have a 1d8 on hit. They still have a +5 to hit, but now for damage they will deal 1d8+3, for 4-11 damage, or an average of 7.5 damage per hit.
The only thing they gained for an ASI was an average of 2 more damage per hit.

Choosing to boost DEX to +4, they now have a +6 to hit(4(DEX)+2(Prof.)) and deal 1d4+4(DEX), for 5-8 damage, or an average of 6.5 per hit.

The wizard that chose to boost his DEX is only down 1 average damage per hit and the ability to fire longbows comparatively, but he gained other benefits as well. His chance to hit; succeed on stealth, sleight of hand, initiative and acrobatics checks; and succeed DEX saving throws all went up by 5%. His AC also increased by 1. +5% chance to hit alone will lead to more damage than 1 more average damage.

The numbers are slightly more favorable when using STR, due to gaining access to 1d12 and 2d6 weapons, but that opens up another can of worms with your survivability.

Overall it makes more sense to either plan ahead and pick a race that offers weapon proficiencies, or to multiclass into a martial class.