I disagree. What France did in Libya is help overthrow a dictator. That's not the same thing as nation-building. Now that Gaddafi is dead, France has no rationale to use force in Libya and cannot impose its will on what happens in Libyan politics.
It is nation building but administering it without occupation through local channels. The NTC has given France the responsibility of enforcing its
foreign policy and providing firepower in return France will be rewarded with a third of Libyan oil contracts. Until Libya builds a credible military that can defend itself, they will be a defacto protectorate of France. The rebuilding has only started and until Libya can stand on its own feet, it will not be done.
The new Libyan government may decide to make Libya an Islamist state or a socialist one, it's entirely up to them and the Libyan people.
France doesn't care if it is an Islamist state or a socialist one, it only cares that business interests remain open and it doesn't support terrorism.
What the US tried to do in Iraq on the other hand is not just to oust a dictator, but to establish a puppet state, control the world's 4th largest oil reserves, and obtain long-term bases in the ME through a pliant ally not capable of offering any resistance. Not only that, but the US charged the entire expense of the invasion and occupation to the Iraqi people.
If you call the current Iraqi government a puppet state the Americans failed miserably. All troops are leaving by the end of the year including trainers. There will be no American bases in Iraq and as soon as they leave the Iranians will exert their influence over the Shia dominated government. The US will have less control of Iraq than France will over Libya.
Afghanistan is another matter, US was forced to invade it to topple the Taliban and thereafter stay to get Bin Laden.
It isn't another matter as they do the same thing as they did in Iraq. They didn't have to stay to get Bin Laden as he was in Pakistan.