2005-01-19 01:09:05 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#include "cmDependsC.h"
|
|
|
|
|
|
|
|
#include "cmSystemTools.h"
|
2005-12-09 21:58:55 +03:00
|
|
|
#include "cmFileTimeComparison.h"
|
2005-01-19 01:09:05 +03:00
|
|
|
|
2005-05-10 19:00:15 +04:00
|
|
|
#include <ctype.h> // isspace
|
|
|
|
|
2005-01-19 01:09:05 +03:00
|
|
|
//----------------------------------------------------------------------------
|
2005-08-17 19:43:58 +04:00
|
|
|
cmDependsC::cmDependsC():
|
2006-03-15 19:02:08 +03:00
|
|
|
IncludePath(0), GeneratedFiles(0)
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
2005-05-11 21:16:45 +04:00
|
|
|
// yummy look at all those constructor arguments
|
2005-07-27 17:49:37 +04:00
|
|
|
cmDependsC::cmDependsC(std::vector<std::string> const& includes,
|
2005-08-17 19:43:58 +04:00
|
|
|
const char* scanRegex, const char* complainRegex,
|
2006-03-10 21:06:26 +03:00
|
|
|
std::set<cmStdString> const& generatedFiles,
|
2005-12-09 21:58:55 +03:00
|
|
|
const cmStdString& cacheFileName):
|
2006-03-15 19:02:08 +03:00
|
|
|
IncludePath(&includes),
|
|
|
|
IncludeRegexLine("^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)([\">])"),
|
|
|
|
IncludeRegexScan(scanRegex),
|
|
|
|
IncludeRegexComplain(complainRegex),
|
|
|
|
GeneratedFiles(&generatedFiles),
|
2006-03-16 17:33:23 +03:00
|
|
|
CacheFileName(cacheFileName)
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2005-12-09 21:58:55 +03:00
|
|
|
this->ReadCacheFile();
|
2005-01-19 01:09:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
cmDependsC::~cmDependsC()
|
|
|
|
{
|
2005-12-09 21:58:55 +03:00
|
|
|
this->WriteCacheFile();
|
|
|
|
|
2006-03-15 19:02:08 +03:00
|
|
|
for (std::map<cmStdString, cmIncludeLines*>::iterator it=
|
|
|
|
this->fileCache.begin(); it!=this->fileCache.end(); ++it)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
|
|
|
delete it->second;
|
|
|
|
}
|
2005-01-19 01:09:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
2005-10-12 21:52:29 +04:00
|
|
|
bool cmDependsC::WriteDependencies(const char *src, const char *obj,
|
|
|
|
std::ostream& makeDepends, std::ostream& internalDepends)
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
// Make sure this is a scanning instance.
|
2005-07-27 17:49:37 +04:00
|
|
|
if(!src || src[0] == '\0')
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2005-07-27 17:49:37 +04:00
|
|
|
cmSystemTools::Error("Cannot scan dependencies without a source file.");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(!obj || obj[0] == '\0')
|
|
|
|
{
|
|
|
|
cmSystemTools::Error("Cannot scan dependencies without an object file.");
|
2005-01-19 01:09:05 +03:00
|
|
|
return false;
|
|
|
|
}
|
2006-03-15 19:02:08 +03:00
|
|
|
if(!this->IncludePath)
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
cmSystemTools::Error("Cannot scan dependencies without an include path.");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Walk the dependency graph starting with the source file.
|
|
|
|
bool first = true;
|
2005-03-03 23:22:18 +03:00
|
|
|
UnscannedEntry root;
|
2005-07-27 17:49:37 +04:00
|
|
|
root.FileName = src;
|
2006-03-15 19:02:08 +03:00
|
|
|
this->Unscanned.push(root);
|
|
|
|
this->Encountered.clear();
|
|
|
|
this->Encountered.insert(src);
|
2005-01-19 01:09:05 +03:00
|
|
|
std::set<cmStdString> dependencies;
|
|
|
|
std::set<cmStdString> scanned;
|
2006-05-03 18:07:08 +04:00
|
|
|
|
2006-03-15 19:02:08 +03:00
|
|
|
while(!this->Unscanned.empty())
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
// Get the next file to scan.
|
2006-03-15 19:02:08 +03:00
|
|
|
UnscannedEntry current = this->Unscanned.front();
|
|
|
|
this->Unscanned.pop();
|
2005-01-19 01:09:05 +03:00
|
|
|
|
|
|
|
// If not a full path, find the file in the include path.
|
|
|
|
std::string fullName;
|
2005-03-03 23:22:18 +03:00
|
|
|
if(first || cmSystemTools::FileIsFullPath(current.FileName.c_str()))
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2005-08-17 19:43:58 +04:00
|
|
|
if(this->FileExistsOrIsGenerated(current.FileName, scanned,
|
|
|
|
dependencies))
|
2005-02-08 00:11:01 +03:00
|
|
|
{
|
2005-03-03 23:22:18 +03:00
|
|
|
fullName = current.FileName;
|
2005-02-08 00:11:01 +03:00
|
|
|
}
|
2005-01-19 01:09:05 +03:00
|
|
|
}
|
2005-03-03 23:22:18 +03:00
|
|
|
else if(!current.QuotedLocation.empty() &&
|
2005-08-17 19:43:58 +04:00
|
|
|
this->FileExistsOrIsGenerated(current.QuotedLocation, scanned,
|
|
|
|
dependencies))
|
2005-03-03 23:22:18 +03:00
|
|
|
{
|
|
|
|
// The include statement producing this entry was a double-quote
|
|
|
|
// include and the included file is present in the directory of
|
|
|
|
// the source containing the include statement.
|
|
|
|
fullName = current.QuotedLocation;
|
|
|
|
}
|
2005-01-19 01:09:05 +03:00
|
|
|
else
|
|
|
|
{
|
2006-05-10 22:54:46 +04:00
|
|
|
for(std::vector<std::string>::const_iterator i =
|
|
|
|
this->IncludePath->begin(); i != this->IncludePath->end(); ++i)
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2005-02-24 20:44:56 +03:00
|
|
|
// Construct the name of the file as if it were in the current
|
|
|
|
// include directory. Avoid using a leading "./".
|
2005-01-19 01:09:05 +03:00
|
|
|
std::string temp = *i;
|
2005-02-24 20:44:56 +03:00
|
|
|
if(temp == ".")
|
|
|
|
{
|
|
|
|
temp = "";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
temp += "/";
|
|
|
|
}
|
2005-03-03 23:22:18 +03:00
|
|
|
temp += current.FileName;
|
2005-02-24 20:44:56 +03:00
|
|
|
|
|
|
|
// Look for the file in this location.
|
2005-08-17 19:43:58 +04:00
|
|
|
if(this->FileExistsOrIsGenerated(temp, scanned, dependencies))
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
fullName = temp;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-08 00:11:01 +03:00
|
|
|
// Complain if the file cannot be found and matches the complain
|
|
|
|
// regex.
|
2005-03-03 23:22:18 +03:00
|
|
|
if(fullName.empty() &&
|
2006-03-15 19:02:08 +03:00
|
|
|
this->IncludeRegexComplain.find(current.FileName.c_str()))
|
2005-02-08 00:11:01 +03:00
|
|
|
{
|
2005-03-03 23:22:18 +03:00
|
|
|
cmSystemTools::Error("Cannot find file \"",
|
|
|
|
current.FileName.c_str(), "\".");
|
2005-02-08 00:11:01 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2005-01-19 01:09:05 +03:00
|
|
|
// Scan the file if it was found and has not been scanned already.
|
2005-02-08 00:11:01 +03:00
|
|
|
if(!fullName.empty() && (scanned.find(fullName) == scanned.end()))
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
// Record scanned files.
|
|
|
|
scanned.insert(fullName);
|
|
|
|
|
2005-12-09 21:58:55 +03:00
|
|
|
// Check whether this file is already in the cache
|
2006-03-15 19:02:08 +03:00
|
|
|
std::map<cmStdString, cmIncludeLines*>::iterator fileIt=
|
|
|
|
this->fileCache.find(fullName);
|
|
|
|
if (fileIt!=this->fileCache.end())
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
fileIt->second->Used=true;
|
2005-01-19 01:09:05 +03:00
|
|
|
dependencies.insert(fullName);
|
2005-12-10 07:04:33 +03:00
|
|
|
for (std::vector<UnscannedEntry>::const_iterator incIt=
|
2006-03-15 19:02:08 +03:00
|
|
|
fileIt->second->UnscannedEntries.begin();
|
|
|
|
incIt!=fileIt->second->UnscannedEntries.end(); ++incIt)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
if (this->Encountered.find(incIt->FileName) ==
|
|
|
|
this->Encountered.end())
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
this->Encountered.insert(incIt->FileName);
|
|
|
|
this->Unscanned.push(*incIt);
|
2005-12-09 21:58:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-12-09 21:58:55 +03:00
|
|
|
// Try to scan the file. Just leave it out if we cannot find
|
|
|
|
// it.
|
|
|
|
std::ifstream fin(fullName.c_str());
|
|
|
|
if(fin)
|
|
|
|
{
|
|
|
|
// Add this file as a dependency.
|
|
|
|
dependencies.insert(fullName);
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-12-09 21:58:55 +03:00
|
|
|
// Scan this file for new dependencies. Pass the directory
|
|
|
|
// containing the file to handle double-quote includes.
|
|
|
|
std::string dir = cmSystemTools::GetFilenamePath(fullName);
|
|
|
|
this->Scan(fin, dir.c_str(), fullName);
|
|
|
|
}
|
2005-01-19 01:09:05 +03:00
|
|
|
}
|
|
|
|
}
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-01-19 01:09:05 +03:00
|
|
|
first = false;
|
|
|
|
}
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-01-19 01:09:05 +03:00
|
|
|
// Write the dependencies to the output stream.
|
2005-10-12 21:52:29 +04:00
|
|
|
internalDepends << obj << std::endl;
|
2005-01-19 01:09:05 +03:00
|
|
|
for(std::set<cmStdString>::iterator i=dependencies.begin();
|
|
|
|
i != dependencies.end(); ++i)
|
|
|
|
{
|
2005-10-12 21:52:29 +04:00
|
|
|
makeDepends << obj << ": "
|
2005-12-09 21:58:55 +03:00
|
|
|
<< cmSystemTools::ConvertToOutputPath(i->c_str()).c_str()
|
|
|
|
<< std::endl;
|
2005-10-12 21:52:29 +04:00
|
|
|
internalDepends << " " << i->c_str() << std::endl;
|
2005-01-19 01:09:05 +03:00
|
|
|
}
|
2005-10-12 21:52:29 +04:00
|
|
|
makeDepends << std::endl;
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-01-19 01:09:05 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
2005-12-09 21:58:55 +03:00
|
|
|
void cmDependsC::ReadCacheFile()
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2006-03-16 17:33:23 +03:00
|
|
|
if(this->CacheFileName.size() == 0)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2006-03-16 17:33:23 +03:00
|
|
|
std::ifstream fin(this->CacheFileName.c_str());
|
2005-12-09 21:58:55 +03:00
|
|
|
if(!fin)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-12-09 21:58:55 +03:00
|
|
|
std::string line;
|
|
|
|
cmIncludeLines* cacheEntry=0;
|
|
|
|
bool haveFileName=false;
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-12-09 21:58:55 +03:00
|
|
|
while(cmSystemTools::GetLineFromStream(fin, line))
|
|
|
|
{
|
|
|
|
if (line.empty())
|
|
|
|
{
|
|
|
|
cacheEntry=0;
|
|
|
|
haveFileName=false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
//the first line after an empty line is the name of the parsed file
|
|
|
|
if (haveFileName==false)
|
|
|
|
{
|
|
|
|
haveFileName=true;
|
|
|
|
int newer=0;
|
|
|
|
cmFileTimeComparison comp;
|
2006-03-16 17:33:23 +03:00
|
|
|
bool res=comp.FileTimeCompare(this->CacheFileName.c_str(),
|
2006-03-15 19:02:08 +03:00
|
|
|
line.c_str(), &newer);
|
|
|
|
|
2005-12-09 21:58:55 +03:00
|
|
|
if ((res==true) && (newer==1)) //cache is newer than the parsed file
|
|
|
|
{
|
|
|
|
cacheEntry=new cmIncludeLines;
|
2006-03-15 19:02:08 +03:00
|
|
|
this->fileCache[line]=cacheEntry;
|
2005-12-09 21:58:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (cacheEntry!=0)
|
|
|
|
{
|
|
|
|
UnscannedEntry entry;
|
|
|
|
entry.FileName = line;
|
|
|
|
if (cmSystemTools::GetLineFromStream(fin, line))
|
|
|
|
{
|
|
|
|
if (line!="-")
|
|
|
|
{
|
|
|
|
entry.QuotedLocation=line;
|
|
|
|
}
|
2006-03-15 19:02:08 +03:00
|
|
|
cacheEntry->UnscannedEntries.push_back(entry);
|
2005-12-09 21:58:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void cmDependsC::WriteCacheFile() const
|
|
|
|
{
|
2006-03-16 17:33:23 +03:00
|
|
|
if(this->CacheFileName.size() == 0)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2006-03-16 17:33:23 +03:00
|
|
|
std::ofstream cacheOut(this->CacheFileName.c_str());
|
2005-12-09 21:58:55 +03:00
|
|
|
if(!cacheOut)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2006-03-15 19:02:08 +03:00
|
|
|
|
|
|
|
for (std::map<cmStdString, cmIncludeLines*>::const_iterator fileIt=
|
|
|
|
this->fileCache.begin();
|
|
|
|
fileIt!=this->fileCache.end(); ++fileIt)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
if (fileIt->second->Used)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
|
|
|
cacheOut<<fileIt->first.c_str()<<std::endl;
|
2006-03-10 21:06:26 +03:00
|
|
|
|
2005-12-10 07:04:33 +03:00
|
|
|
for (std::vector<UnscannedEntry>::const_iterator
|
2006-03-15 19:02:08 +03:00
|
|
|
incIt=fileIt->second->UnscannedEntries.begin();
|
|
|
|
incIt!=fileIt->second->UnscannedEntries.end(); ++incIt)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
|
|
|
cacheOut<<incIt->FileName.c_str()<<std::endl;
|
|
|
|
if (incIt->QuotedLocation.empty())
|
|
|
|
{
|
|
|
|
cacheOut<<"-"<<std::endl;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cacheOut<<incIt->QuotedLocation.c_str()<<std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cacheOut<<std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
2006-03-10 21:06:26 +03:00
|
|
|
void cmDependsC::Scan(std::istream& is, const char* directory,
|
|
|
|
const cmStdString& fullName)
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
|
|
|
cmIncludeLines* newCacheEntry=new cmIncludeLines;
|
2006-03-15 19:02:08 +03:00
|
|
|
newCacheEntry->Used=true;
|
|
|
|
this->fileCache[fullName]=newCacheEntry;
|
|
|
|
|
2005-01-19 01:09:05 +03:00
|
|
|
// Read one line at a time.
|
|
|
|
std::string line;
|
|
|
|
while(cmSystemTools::GetLineFromStream(is, line))
|
|
|
|
{
|
2005-02-08 00:11:01 +03:00
|
|
|
// Match include directives.
|
2006-03-15 19:02:08 +03:00
|
|
|
if(this->IncludeRegexLine.find(line.c_str()))
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
|
|
|
// Get the file being included.
|
2005-03-03 23:22:18 +03:00
|
|
|
UnscannedEntry entry;
|
2006-03-15 19:02:08 +03:00
|
|
|
entry.FileName = this->IncludeRegexLine.match(1);
|
|
|
|
if(this->IncludeRegexLine.match(2) == "\"" &&
|
2006-01-06 01:16:22 +03:00
|
|
|
!cmSystemTools::FileIsFullPath(entry.FileName.c_str()))
|
2005-03-03 23:22:18 +03:00
|
|
|
{
|
2006-01-06 01:16:22 +03:00
|
|
|
// This was a double-quoted include with a relative path. We
|
|
|
|
// must check for the file in the directory containing the
|
|
|
|
// file we are scanning.
|
2005-03-03 23:22:18 +03:00
|
|
|
entry.QuotedLocation = directory;
|
|
|
|
entry.QuotedLocation += "/";
|
|
|
|
entry.QuotedLocation += entry.FileName;
|
|
|
|
}
|
2005-01-19 01:09:05 +03:00
|
|
|
|
2005-02-08 00:11:01 +03:00
|
|
|
// Queue the file if it has not yet been encountered and it
|
2005-03-03 23:22:18 +03:00
|
|
|
// matches the regular expression for recursive scanning. Note
|
|
|
|
// that this check does not account for the possibility of two
|
|
|
|
// headers with the same name in different directories when one
|
|
|
|
// is included by double-quotes and the other by angle brackets.
|
|
|
|
// This kind of problem will be fixed when a more
|
|
|
|
// preprocessor-like implementation of this scanner is created.
|
2006-03-15 19:02:08 +03:00
|
|
|
if (this->IncludeRegexScan.find(entry.FileName.c_str()))
|
2005-01-19 01:09:05 +03:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
newCacheEntry->UnscannedEntries.push_back(entry);
|
|
|
|
if(this->Encountered.find(entry.FileName) == this->Encountered.end())
|
2005-12-09 21:58:55 +03:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
this->Encountered.insert(entry.FileName);
|
|
|
|
this->Unscanned.push(entry);
|
2005-12-09 21:58:55 +03:00
|
|
|
}
|
2005-01-19 01:09:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-05-10 19:00:15 +04:00
|
|
|
|
2005-08-17 19:43:58 +04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
bool cmDependsC::FileExistsOrIsGenerated(const std::string& fname,
|
|
|
|
std::set<cmStdString>& scanned,
|
|
|
|
std::set<cmStdString>& dependencies)
|
|
|
|
{
|
2006-01-06 01:16:22 +03:00
|
|
|
// Check for a generated file.
|
|
|
|
if(this->FileIsGenerated(fname, scanned, dependencies))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if(cmSystemTools::FileIsFullPath(fname.c_str()))
|
|
|
|
{
|
|
|
|
// The generated file may have been listed with a relative path.
|
2006-05-03 18:07:08 +04:00
|
|
|
// Note that CMAKE_GENERATED_FILES is written with a conversion
|
|
|
|
// relative to the home output directory.
|
2006-01-06 01:16:22 +03:00
|
|
|
std::string rname =
|
2006-05-10 22:54:46 +04:00
|
|
|
cmSystemTools::RelativePath(this->HomeOutputDirectory.c_str(),
|
|
|
|
fname.c_str());
|
2006-01-06 01:16:22 +03:00
|
|
|
if(this->FileIsGenerated(rname, scanned, dependencies))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check for an existing file.
|
|
|
|
return cmSystemTools::FileExists(fname.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
bool cmDependsC::FileIsGenerated(const std::string& fname,
|
|
|
|
std::set<cmStdString>& scanned,
|
|
|
|
std::set<cmStdString>& dependencies)
|
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
if(this->GeneratedFiles &&
|
2006-05-10 22:54:46 +04:00
|
|
|
std::set<cmStdString>::const_iterator(this->GeneratedFiles->find(fname))
|
|
|
|
!= this->GeneratedFiles->end())
|
2005-08-17 19:43:58 +04:00
|
|
|
{
|
|
|
|
// If the file does not really exist yet pretend it has already
|
|
|
|
// been scanned. When it exists later then dependencies will be
|
|
|
|
// rescanned.
|
|
|
|
if(!cmSystemTools::FileExists(fname.c_str()))
|
|
|
|
{
|
|
|
|
scanned.insert(fname);
|
|
|
|
dependencies.insert(fname);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-01-06 01:16:22 +03:00
|
|
|
return false;
|
2005-08-17 19:43:58 +04:00
|
|
|
}
|
|
|
|
}
|