Fixes to build with cmake 3