MCPcopy Create free account
hub / github.com/Kitware/CMake / TargetSourcesImpl

Class TargetSourcesImpl

Source/cmTargetSourcesCommand.cxx:51–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 cmArgumentParser<FileSetsArgs>().Bind("FILE_SET"_s, &FileSetsArgs::FileSets);
50
51class TargetSourcesImpl : public cmTargetPropCommandBase
52{
53public:
54 using cmTargetPropCommandBase::cmTargetPropCommandBase;
55
56protected:
57 void HandleInterfaceContent(cmTarget* tgt,
58 std::vector<std::string> const& content,
59 bool prepend, bool system) override
60 {
61 this->cmTargetPropCommandBase::HandleInterfaceContent(
62 tgt,
63 this->ConvertToAbsoluteContent(tgt, content, IsInterface::Yes,
64 CheckCMP0076::Yes),
65 prepend, system);
66 }
67
68private:
69 void HandleMissingTarget(std::string const& name) override
70 {
71 this->Makefile->IssueMessage(
72 MessageType::FATAL_ERROR,
73 cmStrCat("Cannot specify sources for target \"", name,
74 "\" which is not built by this project."));
75 }
76
77 bool HandleDirectContent(cmTarget* tgt,
78 std::vector<std::string> const& content,
79 bool /*prepend*/, bool /*system*/) override
80 {
81 tgt->AppendProperty("SOURCES",
82 this->Join(this->ConvertToAbsoluteContent(
83 tgt, content, IsInterface::No, CheckCMP0076::Yes)),
84 this->Makefile->GetBacktrace());
85 return true; // Successfully handled.
86 }
87
88 bool PopulateTargetProperties(std::string const& scope,
89 std::vector<std::string> const& content,
90 bool prepend, bool system) override
91 {
92 if (!content.empty() && content.front() == "FILE_SET"_s) {
93 return this->HandleFileSetMode(scope, content);
94 }
95 return this->cmTargetPropCommandBase::PopulateTargetProperties(
96 scope, content, prepend, system);
97 }
98
99 std::string Join(std::vector<std::string> const& content) override
100 {
101 return cmList::to_string(content);
102 }
103
104 enum class IsInterface
105 {
106 Yes,
107 No,
108 };

Callers 1

cmTargetSourcesCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…