cmake macos, more fixes and cleanup