From 1349d06e7851e7d73b8cfbea00d89bfb074a2acb Mon Sep 17 00:00:00 2001 From: Dan Blezek Date: Fri, 4 May 2001 16:44:24 -0400 Subject: ENH: Proper build name --- Source/cmBuildNameCommand.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Source/cmBuildNameCommand.cxx') diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 654ede059b..83cabc29b0 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -59,10 +59,24 @@ bool cmBuildNameCommand::Invoke(std::vector& args) if(m_Makefile->GetDefinition("UNIX")) { buildname = ""; - cmSystemTools::RunCommand("uname", + cmSystemTools::RunCommand("uname -a", buildname); + if(buildname.length()) + { + std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) "; + cmRegularExpression reg( RegExp.c_str() ); + if(reg.find(buildname.c_str())) + { + buildname = reg.match(1) + "-" + reg.match(2); + } + } + } - + + std::string compiler = "-${CXX}"; + m_Makefile->ExpandVariablesInString ( compiler ); + buildname += compiler; + cmCacheManager::GetInstance()-> AddCacheEntry("BUILDNAME", buildname.c_str(), -- cgit v1.2.1