diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-04-13 20:35:26 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-04-13 20:35:26 (GMT) |
commit | 826405a1b668900ef4d5ecc0b676197e978bb80f (patch) | |
tree | ff388e4ea49a6368370e2d67de5486d0a4a7c7ae /Source/cmSourceFile.cxx | |
parent | 030dd4b91e4023ce73ae0c9ca675227202ed1e1b (diff) | |
download | CMake-826405a1b668900ef4d5ecc0b676197e978bb80f.zip CMake-826405a1b668900ef4d5ecc0b676197e978bb80f.tar.gz CMake-826405a1b668900ef4d5ecc0b676197e978bb80f.tar.bz2 |
ENH: Speedup by storing source name without last extension
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6fac024..8da72c3 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -29,6 +29,7 @@ void cmSourceFile::SetName(const char* name, const char* dir, { this->SetProperty("HEADER_FILE_ONLY","1"); + m_SourceNameWithoutLastExtension = ""; m_SourceName = name; @@ -142,6 +143,7 @@ void cmSourceFile::SetName(const char* name, const char* dir, const char *ext, bool hfo) { this->SetProperty("HEADER_FILE_ONLY",(hfo ? "1" : "0")); + m_SourceNameWithoutLastExtension = ""; m_SourceName = name; std::string pathname = dir; if(pathname != "") @@ -210,3 +212,12 @@ void cmSourceFile::SetCustomCommand(cmCustomCommand* cc) } m_CustomCommand = cc; } + +const std::string& cmSourceFile::GetSourceNameWithoutLastExtension() +{ + if ( m_SourceNameWithoutLastExtension.empty() ) + { + m_SourceNameWithoutLastExtension = cmSystemTools::GetFilenameWithoutLastExtension(m_FullPath); + } + return m_SourceNameWithoutLastExtension; +} |