target_sources: Interpret relative paths as relative to the calling directory

Previously the command considered non-absolute source file paths relative to
the associated target on the LHS. This causes problems in incremental builds
where files are added from subdirectories and forces users to workaround by
manually converting to absolute paths. Change this to enable more intuitive
usage by projects.

Fixes #17981
This commit is contained in:
Patrick Stotko
2018-06-02 17:20:51 +02:00
parent f31d4ac7d6
commit 316815e1f4
46 changed files with 447 additions and 4 deletions
+9
View File
@@ -29,6 +29,11 @@ public:
bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status) override;
protected:
void HandleInterfaceContent(cmTarget* tgt,
const std::vector<std::string>& content,
bool prepend, bool system) override;
private:
void HandleMissingTarget(const std::string& name) override;
@@ -37,6 +42,10 @@ private:
bool prepend, bool system) override;
std::string Join(const std::vector<std::string>& content) override;
std::vector<std::string> ConvertToAbsoluteContent(
cmTarget* tgt, const std::vector<std::string>& content,
bool isInterfaceContent);
};
#endif