summaryrefslogtreecommitdiffstats
path: root/Source/cmBuildNameCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-07-10 13:23:34 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-07-10 13:23:34 (GMT)
commite0fa3f281c4d65a347759bae9848c9fb703db6bc (patch)
tree8fe23a29d13ad12d4534fcbe91ca26f07ab2bc46 /Source/cmBuildNameCommand.cxx
parentb4462da66a88657821ade81cfb9afaad4e1dd25d (diff)
downloadCMake-e0fa3f281c4d65a347759bae9848c9fb703db6bc.zip
CMake-e0fa3f281c4d65a347759bae9848c9fb703db6bc.tar.gz
CMake-e0fa3f281c4d65a347759bae9848c9fb703db6bc.tar.bz2
changes to better handle old values or hand set values
Diffstat (limited to 'Source/cmBuildNameCommand.cxx')
-rw-r--r--Source/cmBuildNameCommand.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 91b7edb..9bf4b1a 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -52,9 +52,29 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string>& args)
= cmCacheManager::GetInstance()->GetCacheValue("BUILDNAME");
if(cacheValue)
{
- m_Makefile->AddDefinition("BUILDNAME", cacheValue);
+ // do we need to correct the value?
+ cmRegularExpression reg("[()/]");
+ if (reg.find(cacheValue))
+ {
+ std::string cv = cacheValue;
+ cmSystemTools::ReplaceString(cv,"/", "_");
+ cmSystemTools::ReplaceString(cv,"(", "_");
+ cmSystemTools::ReplaceString(cv,")", "_");
+ cmCacheManager::GetInstance()->
+ AddCacheEntry("BUILDNAME",
+ cv.c_str(),
+ "Name of build.",
+ cmCacheManager::STRING);
+ m_Makefile->AddDefinition("BUILDNAME", cv.c_str());
+ }
+ else
+ {
+ m_Makefile->AddDefinition("BUILDNAME", cacheValue);
+ }
return true;
}
+
+
std::string buildname = "WinNT";
if(m_Makefile->GetDefinition("UNIX"))
{