Begin rewrite complex cmake