With high rates of unemployment among Senegalese youth and illegal migration to Europe persisting, Senegal has partnered with the Spanish government to give young people skills that respond to the local job market.
Almost a third of young people in Senegal are unemployed. Many leave their villages and come to the northern city of St. Louis in search of work.
Opportunities are few and most end up hawking goods on the street.
Now, Senegal and Spain have embarked on a project to give young people the skills for local jobs and, as a result, to stem the illegal immigration to Europe. The project also aims to restore part of Senegal's cultural heritage.
This is Rogniat North. It's a renovated French army barracks that dates to the 1850s when French West Africa was ruled from St. Louis.
Across the square, its twin Rogniat South has been neglected for decades.
But now Rogniat South serves as both classroom and workshop for budding masons, electricians, metal-workers and painters who will renovate the building over the next 18 months.
Gora Gueye is director of the trade schools.
"What is unique about the project is that it is based on the local market's needs," he said. "We looked at which sectors needed skilled workers, then we set up professional training schools in those specialized areas."
Abdourahmane Touré is learning to be a painter-plasterer. A year ago, he was on a fishing boat headed for Spain.
"We spent two days at sea before washing up on the shores of Morocco," he said. "I had no money or friends, so I had to work in the market carrying bags until I had enough for the fare back home to Senegal. Now I am happy to be working on these historic buildings."
Gueye says skilled construction workers are in demand here. St. Louis, a World Heritage Site, has many buildings in need of restoration.
Senegal has been a jumping off point for Africans heading to Europe for work. Many make it only as far as detention centers, like this one in Spain, and then are expelled. To partly combat the problem, the European Union has been allowing some legal immigration, favoring people who have skills needed in the EU.
Touré is optimistic that, with his new skills, he will be able to get a decent job in Senegal.
"I will never get on a boat to Europe again," he said.
But he says, God willing, he will go - legally - by plane.