summaryrefslogtreecommitdiffstats
path: root/Source/cmOutputRequiredFilesCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmOutputRequiredFilesCommand.cxx')
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx34
1 files changed, 22 insertions, 12 deletions
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 8b629fe..7a17f2c 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -2,8 +2,21 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmOutputRequiredFilesCommand.h"
-#include "cmAlgorithms.h"
#include <cmsys/FStream.hxx>
+#include <cmsys/RegularExpression.hxx>
+#include <map>
+#include <utility>
+
+#include "cmAlgorithms.h"
+#include "cmGeneratorExpression.h"
+#include "cmMakefile.h"
+#include "cmPolicies.h"
+#include "cmSourceFile.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+#include "cm_unordered_map.hxx"
+
+class cmExecutionStatus;
/** \class cmDependInformation
* \brief Store dependency information for a single source file.
@@ -167,33 +180,30 @@ protected:
while (cmSystemTools::GetLineFromStream(fin, line)) {
if (cmHasLiteralPrefix(line.c_str(), "#include")) {
// if it is an include line then create a string class
- std::string currentline = line;
- size_t qstart = currentline.find('\"', 8);
+ size_t qstart = line.find('\"', 8);
size_t qend;
// if a quote is not found look for a <
if (qstart == std::string::npos) {
- qstart = currentline.find('<', 8);
+ qstart = line.find('<', 8);
// if a < is not found then move on
if (qstart == std::string::npos) {
- cmSystemTools::Error("unknown include directive ",
- currentline.c_str());
+ cmSystemTools::Error("unknown include directive ", line.c_str());
continue;
} else {
- qend = currentline.find('>', qstart + 1);
+ qend = line.find('>', qstart + 1);
}
} else {
- qend = currentline.find('\"', qstart + 1);
+ qend = line.find('\"', qstart + 1);
}
// extract the file being included
- std::string includeFile =
- currentline.substr(qstart + 1, qend - qstart - 1);
+ std::string includeFile = line.substr(qstart + 1, qend - qstart - 1);
// see if the include matches the regular expression
if (!this->IncludeFileRegularExpression.find(includeFile)) {
if (this->Verbose) {
std::string message = "Skipping ";
message += includeFile;
message += " for file ";
- message += info->FullPath.c_str();
+ message += info->FullPath;
cmSystemTools::Error(message.c_str(), CM_NULLPTR);
}
continue;
@@ -507,7 +517,7 @@ bool cmOutputRequiredFilesCommand::InitialPass(
const cmDependInformation* info = md.FindDependencies(this->File.c_str());
if (info) {
// write them out
- FILE* fout = cmsys::SystemTools::Fopen(this->OutputFile.c_str(), "w");
+ FILE* fout = cmsys::SystemTools::Fopen(this->OutputFile, "w");
if (!fout) {
std::string err = "Can not open output file: ";
err += this->OutputFile;