CMake 3.16-rc3 with the Xcode generator generates invalid entry for CMakeLists.txt
I gave a try with CMake 3.16-rc3 on one of our projects, and noticed that when I viewed the generated .xcodeproj in the Xcode IDE each target had a weird empty entry that when opened, stated “The file couldn’t be opened because you don’t have permission to view it.”
Here’s a screenshot from trying to build googletest:
This is happening in each project I’ve tried, and note the blank entries where you’d normally see a CMakeLists.txt. Looking in the generated project.pbxproj, I notice a weird entry in the PBXGroup section:
FCC28A7F74264D458770B641 /* gtest */ = {
isa = PBXGroup;
children = (
BF1EA80837A243D48244B25D /* Source Files */,
A820BC1E8A784BAFB1E02AA9,
);
name = gtest;
sourceTree = "<group>";
};
Also note that the above hash points to a broken entry in the PBXFileReferenceSection:
A820BC1E8A784BAFB1E02AA9 = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 4; name = ""; path = ""; sourceTree = SOURCE_ROOT; };
Compare that to the same project in CMake 3.15.4:
PBXGroup
A41D9DD3481542C7A0523855 /* gtest */ = {
isa = PBXGroup;
children = (
283C4B2C019A4C44AE0E5379 /* Source Files */,
4E8A6F14AAD84ED990C56B02 /* /Users/remyjette/src/googletest/googletest/CMakeLists.txt */,
);
name = gtest;
sourceTree = "<group>";
};
and PBXFileReference
4E8A6F14AAD84ED990C56B02 /* /Users/remyjette/src/googletest/googletest/CMakeLists.txt */ = {isa = PBXFileReference; explicitFileType = sourcecode.text; fileEncoding = 4; name = CMakeLists.txt; path = googletest/CMakeLists.txt; sourceTree = SOURCE_ROOT; };