Fixing external cmake builds