summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-02-19 20:13:48 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-02-19 20:13:48 (GMT)
commit89e037ee19ed033fee0830a0c56c7ae956265512 (patch)
tree7a98427243bde8b3e73210dee288784981b46f9c /Source/cmFindLibraryCommand.cxx
parenta4bbb55efdbb8d1b948b55248b54a3532f2f9d41 (diff)
downloadCMake-89e037ee19ed033fee0830a0c56c7ae956265512.zip
CMake-89e037ee19ed033fee0830a0c56c7ae956265512.tar.gz
CMake-89e037ee19ed033fee0830a0c56c7ae956265512.tar.bz2
ENH: first pass at cache, clean up the unix generator, clean up configure.in some
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r--Source/cmFindLibraryCommand.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 883a5ea..e241f50 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -14,6 +14,7 @@
=========================================================================*/
#include "cmFindLibraryCommand.h"
+#include "cmCacheManager.h"
// cmFindLibraryCommand
bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args)
@@ -23,7 +24,15 @@ bool cmFindLibraryCommand::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++)
@@ -44,9 +53,13 @@ bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args)
tryPath += args[1];
if(cmSystemTools::FileExists(tryPath.c_str()))
{
- m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
+ m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
+ cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
+ path[k].c_str(),
+ cmCacheManager::PATH);
return true;
}
}
+ return false;
}