Further cmake mods
Further cmake changes. sw envelope fixes