1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2013 Stephen Kelly <steveire@gmail.com>
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmTargetCompileOptionsCommand.h"
14 bool cmTargetCompileOptionsCommand
15 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
17 return this->HandleArguments(args, "COMPILE_OPTIONS", PROCESS_BEFORE);
20 void cmTargetCompileOptionsCommand
21 ::HandleImportedTarget(const std::string &tgt)
24 e << "Cannot specify compile options for imported target \""
26 this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
29 void cmTargetCompileOptionsCommand
30 ::HandleMissingTarget(const std::string &name)
33 e << "Cannot specify compile options for target \"" << name << "\" "
34 "which is not built by this project.";
35 this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
38 //----------------------------------------------------------------------------
39 std::string cmTargetCompileOptionsCommand
40 ::Join(const std::vector<std::string> &content)
44 for(std::vector<std::string>::const_iterator it = content.begin();
45 it != content.end(); ++it)
53 //----------------------------------------------------------------------------
54 void cmTargetCompileOptionsCommand
55 ::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
58 cmListFileBacktrace lfbt;
59 this->Makefile->GetBacktrace(lfbt);
60 cmValueWithOrigin entry(this->Join(content), lfbt);
61 tgt->InsertCompileOption(entry);