Give cmake an optional reference to ps

+ more build fixes