diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 212eb12236..ff72152097 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1962,3 +1962,17 @@ GetTargetObjectFileDirectories(cmTarget* target, std::cerr << dir << "\n"; dirs.push_back(dir); } + + + // return the source name for the object file +std::string cmLocalVisualStudio7Generator::GetSourceObjectName(cmSourceFile& sf ) +{ + std::string ret = sf.GetSourceName(); + std::string::size_type pos = ret.find("/"); + if(pos == ret.npos) + { + return ret; + } + return ret.substr(pos+1); +} + diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 746e65711e..22147c76f5 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -68,7 +68,9 @@ public: virtual void ConfigureFinalPass(); void GetTargetObjectFileDirectories(cmTarget* target, std::vector& - dirs); + dirs); + // return the source name for the object file + virtual std::string GetSourceObjectName(cmSourceFile& ); private: typedef cmLocalVisualStudio7GeneratorOptions Options; diff --git a/Tests/ConvLibrary/bartest.cxx b/Tests/ConvLibrary/bartest.cxx index aa3afcb0b1..ab9577304d 100644 --- a/Tests/ConvLibrary/bartest.cxx +++ b/Tests/ConvLibrary/bartest.cxx @@ -25,11 +25,11 @@ int main() } if(car() == 30) { - printf("bar is 30!\n"); + printf("car is 30!\n"); } else { - printf("bar is not 30 error!\n"); + printf("car is not 30 error!\n"); return -1; } printf("Test past\n");