summaryrefslogtreecommitdiffstats
path: root/Source/cmFindIncludeCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindIncludeCommand.cxx')
-rw-r--r--Source/cmFindIncludeCommand.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/cmFindIncludeCommand.cxx b/Source/cmFindIncludeCommand.cxx
index 706a617..b1f095e 100644
--- a/Source/cmFindIncludeCommand.cxx
+++ b/Source/cmFindIncludeCommand.cxx
@@ -14,6 +14,7 @@
=========================================================================*/
#include "cmFindIncludeCommand.h"
+#include "cmCacheManager.h"
// cmFindIncludeCommand
bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args)
@@ -23,7 +24,15 @@ bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args)
this->SetError("called with incorrect number of arguments");
return false;
}
-
+ // Now check and see if the value has been stored in the cache
+ // 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)
+ {
+ m_Makefile->AddDefinition(args[0].c_str(), cacheValue);
+ return true;
+ }
std::vector<std::string> path;
// add any user specified paths
for (int j = 2; j < args.size(); j++)
@@ -45,8 +54,13 @@ bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args)
if(cmSystemTools::FileExists(tryPath.c_str()))
{
m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
+ // Save the value in the cache
+ cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
+ path[k].c_str(),
+ cmCacheManager::PATH);
return true;
}
}
+ return false;
}