Both have their advantages...
I prefer to focus on true campaign building blocks (plotlines, adventures, NPCs, locations, encounters and villains) rather than worldbuilding, which for me often constitutes too much time investment for too little gameplay return. There's already too much to do without outlining setting features halfway around the world that, realistically, most of which the players will probably never encounter, interact with nor care about.
When homebrewing, I prefer to map out the campaign structure and adventures first, and design the setting to support and enhance those themes. This has taken the form in the past of grabbing a stack of Dungeon magazine adventures I want to run and sketching in the terrain and urban areas they'll need on a map the size of an A4 page, only developing the rest of the setting in the form of a few rumours of empires of giants across the sea and such. IMO, this "adventure heavy, setting lite" style is preferable to "setting heavy, adventure lite" which many DMs prefer to focus on, such as in a campaign I'm currently playing in. I know a lot of other people try to shoehorn campaign structure around a setting they've already developed rather than design the setting specifically to meet campaign needs. This seems somewhat back-to-front to me, unless the setting serves as a source of inspiration that outweighs the potential restrictions it places on campaign composition.
As Psion points out, this is also what is being done when you use someone's published world and do your best to stay true to it - placing the setting's needs before those of the campaign, which is again somewhat back-to-front unless the setting adds to campaign inspiration to an extent that it outweighs inflexibility. For me, the compromise lies in setting the campaign in an underdeveloped part of a published campaign world. There are enough cracks in the detail to fill in within that locality to enable molding the setting to suit adventure and campaign needs (so effectively you're semi-homebrewing) yet there is no need to worry about developing the wider world and setting flavour - that work has been done for you. So long as your campaign structure and themes fit the setting (which is usually relatively easy to do in fairly generic D&D settings such as FR or GH), you can have your cake and eat it - to an extent.