Newbuild merge

- Mainly fixed Realmd to compile with cmake under both Windows and Linux.