diff options
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index b8a547a..ed8d63f 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -30,12 +30,8 @@ void cmSourceFile::SetName(const char* name, const char* dir, this->SetProperty("HEADER_FILE_ONLY","1"); - m_SourceName = cmSystemTools::GetFilenamePath(name); - if ( m_SourceName.size() > 0 ) - { - m_SourceName += "/"; - } - m_SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name); + + m_SourceName = name; std::string pathname = dir; @@ -58,6 +54,12 @@ void cmSourceFile::SetName(const char* name, const char* dir, std::string hname = pathname; if(cmSystemTools::FileExists(hname.c_str())) { + m_SourceName = cmSystemTools::GetFilenamePath(name); + if ( m_SourceName.size() > 0 ) + { + m_SourceName += "/"; + } + m_SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name); std::string::size_type pos = hname.rfind('.'); if(pos != std::string::npos) { @@ -74,7 +76,7 @@ void cmSourceFile::SetName(const char* name, const char* dir, // See if the file is a header file if(std::find( headerExts.begin(), headerExts.end(), m_SourceExtension ) == - headerExts.end()) + headerExts.end()) { this->SetProperty("HEADER_FILE_ONLY","0"); } |