diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-04-27 13:22:57 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-04-27 13:22:57 (GMT) |
commit | 482eef71122acf6408e0d5bd02161bb832155f08 (patch) | |
tree | 61500ef9273621f9d8816b2286ed6c8838137e30 /Source/cmSourceFile.cxx | |
parent | c19a70b3ada66a59c7a0ff78bf1a4a1cd557db9a (diff) | |
download | CMake-482eef71122acf6408e0d5bd02161bb832155f08.zip CMake-482eef71122acf6408e0d5bd02161bb832155f08.tar.gz CMake-482eef71122acf6408e0d5bd02161bb832155f08.tar.bz2 |
BUG: Fix aus source dir and add better testing of it
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"); } |