Backport module/pg cmake changes from master to stable
Merge branch 'stable'