Use cmake

Needs testing