cmake/Source/cmTargetSourcesCommand.cxx

41 lines
1.1 KiB
C++
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2015-04-27 22:25:09 +02:00
#include "cmTargetSourcesCommand.h"
2017-04-14 19:02:05 +02:00
#include <sstream>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
bool cmTargetSourcesCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
2015-04-27 22:25:09 +02:00
{
return this->HandleArguments(args, "SOURCES");
}
2016-07-09 11:21:54 +02:00
void cmTargetSourcesCommand::HandleMissingTarget(const std::string& name)
2015-04-27 22:25:09 +02:00
{
std::ostringstream e;
2016-07-09 11:21:54 +02:00
e << "Cannot specify sources for target \"" << name
<< "\" "
2015-04-27 22:25:09 +02:00
"which is not built by this project.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
2016-07-09 11:21:54 +02:00
std::string cmTargetSourcesCommand::Join(
const std::vector<std::string>& content)
2015-04-27 22:25:09 +02:00
{
return cmJoin(content, ";");
}
2016-07-09 11:21:54 +02:00
bool cmTargetSourcesCommand::HandleDirectContent(
cmTarget* tgt, const std::vector<std::string>& content, bool, bool)
2015-04-27 22:25:09 +02:00
{
tgt->AppendProperty("SOURCES", this->Join(content).c_str());
2018-04-23 21:13:27 +02:00
return true; // Successfully handled.
2015-04-27 22:25:09 +02:00
}