First working version with cmake