summaryrefslogtreecommitdiff
path: root/Source/cmFindFileCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-04-27 09:30:27 -0400
committerKen Martin <ken.martin@kitware.com>2001-04-27 09:30:27 -0400
commit07bd60f6b3db36fdaf13661f70e8bb7507317254 (patch)
tree49f5022c7eb6286791ffc548e1638ada5122c4cc /Source/cmFindFileCommand.cxx
parentdbdf1c356bbacb5142a1d7bb145bcd26a6fd6a9c (diff)
downloadcmake-07bd60f6b3db36fdaf13661f70e8bb7507317254.tar.gz
better help strings
Diffstat (limited to 'Source/cmFindFileCommand.cxx')
-rw-r--r--Source/cmFindFileCommand.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmFindFileCommand.cxx b/Source/cmFindFileCommand.cxx
index 9d5f1311ec..21283562fa 100644
--- a/Source/cmFindFileCommand.cxx
+++ b/Source/cmFindFileCommand.cxx
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// cmFindFileCommand
bool cmFindFileCommand::Invoke(std::vector<std::string>& args)
{
- if(args.size() < 2 )
+ if(args.size() < 2)
{
this->SetError("called with incorrect number of arguments");
return false;
@@ -59,6 +59,8 @@ bool cmFindFileCommand::Invoke(std::vector<std::string>& args)
i++; // move iterator to next arg
// 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
+ std::string helpString = "Where can the ";
+ helpString += args[1] + " file be found";
const char* cacheValue
= cmCacheManager::GetInstance()->GetCacheValue(define);
if(cacheValue)
@@ -66,6 +68,11 @@ bool cmFindFileCommand::Invoke(std::vector<std::string>& args)
if(strcmp(cacheValue, "NOTFOUND") != 0)
{
m_Makefile->AddDefinition(define, cacheValue);
+ // update help string if changed
+ cmCacheManager::GetInstance()->AddCacheEntry(define,
+ cacheValue,
+ helpString.c_str(),
+ cmCacheManager::FILEPATH);
}
return true;
}
@@ -91,11 +98,11 @@ bool cmFindFileCommand::Invoke(std::vector<std::string>& args)
if(cmSystemTools::FileExists(tryPath.c_str()))
{
// Save the value in the cache
+ m_Makefile->AddDefinition(define, tryPath.c_str());
cmCacheManager::GetInstance()->AddCacheEntry(define,
tryPath.c_str(),
- "Path to a file.",
+ helpString.c_str(),
cmCacheManager::FILEPATH);
- m_Makefile->AddDefinition(define, tryPath.c_str());
return true;
}
}