summaryrefslogtreecommitdiffstats
path: root/Source/cmFindIncludeCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindIncludeCommand.cxx')
-rw-r--r--Source/cmFindIncludeCommand.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/cmFindIncludeCommand.cxx b/Source/cmFindIncludeCommand.cxx
index ec33f4d..645ed0d 100644
--- a/Source/cmFindIncludeCommand.cxx
+++ b/Source/cmFindIncludeCommand.cxx
@@ -28,9 +28,12 @@ bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args)
// already, if so use that value and don't look for the program
const char* cacheValue
= cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str());
- if(cacheValue)
+ if(cacheValue )
{
- m_Makefile->AddDefinition(args[0].c_str(), cacheValue);
+ if(strcmp(cacheValue, "NOTFOUND") != 0)
+ {
+ m_Makefile->AddDefinition(args[0].c_str(), cacheValue);
+ }
return true;
}
std::vector<std::string> path;
@@ -45,8 +48,8 @@ bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args)
// add the standard path
cmSystemTools::GetPath(path);
-
- for(unsigned int k=0; k < path.size(); k++)
+ unsigned int k;
+ for(k=0; k < path.size(); k++)
{
std::string tryPath = path[k];
tryPath += "/";
@@ -61,6 +64,19 @@ bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args)
return true;
}
}
+ cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
+ "NOTFOUND",
+ cmCacheManager::PATH);
+ std::string message = "Include not found: ";
+ message += args[1];
+ message += "\n";
+ message += "looked in ";
+ for(k=0; k < path.size(); k++)
+ {
+ message += path[k];
+ message += "\n";
+ }
+ this->SetError(message.c_str());
return false;
}