Added missing cmake macros + minor fixes