summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-01 10:05:13 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-01 11:07:11 (GMT)
commit6c0e9ee276e9e35a970990baec09c0c2c85b3804 (patch)
tree1ab194088ca83c2e6bcb6c5bfd09ac69a8e3be13 /Source/cmLocalGenerator.cxx
parent9432b14e916421a727265f9a05dc1fbe6c6ec381 (diff)
downloadCMake-6c0e9ee276e9e35a970990baec09c0c2c85b3804.zip
CMake-6c0e9ee276e9e35a970990baec09c0c2c85b3804.tar.gz
CMake-6c0e9ee276e9e35a970990baec09c0c2c85b3804.tar.bz2
cmMakefile: Store EvaluationFiles.
Relieve the cmGlobalGenerator of this responsibility. Evaluate the generator expressions in the context of the cmLocalGenerator.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6b48a44..7cc256a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -16,6 +16,7 @@
#include "cmGlobalGenerator.h"
#include "cmInstallGenerator.h"
#include "cmInstallFilesGenerator.h"
+#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmInstallScriptGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmMakefile.h"
@@ -212,6 +213,53 @@ void cmLocalGenerator::GenerateTestFiles()
}
}
+void cmLocalGenerator::CreateEvaluationFileOutputs(std::string const& config)
+{
+ std::vector<cmGeneratorExpressionEvaluationFile*> ef =
+ this->Makefile->GetEvaluationFiles();
+ for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
+ li = ef.begin(); li != ef.end(); ++li)
+ {
+ (*li)->CreateOutputFile(config);
+ }
+}
+
+void cmLocalGenerator::ProcessEvaluationFiles(
+ std::vector<std::string>& generatedFiles)
+{
+ std::vector<cmGeneratorExpressionEvaluationFile*> ef =
+ this->Makefile->GetEvaluationFiles();
+ for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
+ li = ef.begin();
+ li != ef.end();
+ ++li)
+ {
+ (*li)->Generate();
+ if (cmSystemTools::GetFatalErrorOccured())
+ {
+ return;
+ }
+ std::vector<std::string> files = (*li)->GetFiles();
+ std::sort(files.begin(), files.end());
+
+ std::vector<std::string> intersection;
+ std::set_intersection(files.begin(), files.end(),
+ generatedFiles.begin(), generatedFiles.end(),
+ std::back_inserter(intersection));
+ if (!intersection.empty())
+ {
+ cmSystemTools::Error("Files to be generated by multiple different "
+ "commands: ", cmWrap('"', intersection, '"', " ").c_str());
+ return;
+ }
+
+ generatedFiles.insert(generatedFiles.end(), files.begin(), files.end());
+ std::vector<std::string>::iterator newIt =
+ generatedFiles.end() - files.size();
+ std::inplace_merge(generatedFiles.begin(), newIt, generatedFiles.end());
+ }
+}
+
//----------------------------------------------------------------------------
void cmLocalGenerator::GenerateInstallRules()
{