Restore support for explicitly referenced CMakeLists.txt sources

Since commit v3.11.0-rc1~467^2 (VS,Xcode: Add CMakeLists.txt sources
without mutating targets, 2017-10-18) we do not add `CMakeLists.txt` to
target sources but instead generate references to them directly.  This
broke projects that explicitly specify their `CMakeLists.txt` file as a
source file because the explicit entry is no longer consolidated with
the generated one.

Teach the relevant generators to avoid duplicating `CMakeLists.txt`
source references and add test cases.

Fixes: #17828
This commit is contained in:
Brad King
2018-04-13 08:49:37 -04:00
parent 61fd4c7420
commit 8480c2afc0
10 changed files with 91 additions and 9 deletions

View File

@@ -198,6 +198,8 @@ private:
cmGeneratorTarget* target);
cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, cmSourceFile* sf,
cmGeneratorTarget* gtgt);
void AddXCodeProjBuildRule(cmGeneratorTarget* target,
std::vector<cmSourceFile*>& sources) const;
bool CreateXCodeTargets(cmLocalGenerator* gen, std::vector<cmXCodeObject*>&);
bool IsHeaderFile(cmSourceFile*);
void AddDependTarget(cmXCodeObject* target, cmXCodeObject* dependTarget);