summaryrefslogtreecommitdiffstats
path: root/Source/cmClassFile.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-02-26 22:15:44 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-02-26 22:15:44 (GMT)
commit3b338dacaf0baca14bcffbdaae4a44bc4dbcc7e3 (patch)
tree48021fb9bae94622d3fd3c775fa987e7ae5a0f3b /Source/cmClassFile.cxx
parent7cde8fd0f47143090b81dff813270f6894004af3 (diff)
downloadCMake-3b338dacaf0baca14bcffbdaae4a44bc4dbcc7e3.zip
CMake-3b338dacaf0baca14bcffbdaae4a44bc4dbcc7e3.tar.gz
CMake-3b338dacaf0baca14bcffbdaae4a44bc4dbcc7e3.tar.bz2
added functionality, fixed bug if no file existed and with header files
Diffstat (limited to 'Source/cmClassFile.cxx')
-rw-r--r--Source/cmClassFile.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/cmClassFile.cxx b/Source/cmClassFile.cxx
index 8e408156..67d7436 100644
--- a/Source/cmClassFile.cxx
+++ b/Source/cmClassFile.cxx
@@ -49,6 +49,7 @@ void cmClassFile::SetName(const char* name, const char* dir)
hname += ".cxx";
if(cmSystemTools::FileExists(hname.c_str()))
{
+ m_ClassExtension = "cxx";
m_HeaderFileOnly = false;
m_FullPath = hname;
return;
@@ -59,6 +60,7 @@ void cmClassFile::SetName(const char* name, const char* dir)
if(cmSystemTools::FileExists(hname.c_str()))
{
m_HeaderFileOnly = false;
+ m_ClassExtension = "c";
m_FullPath = hname;
return;
}
@@ -67,18 +69,39 @@ void cmClassFile::SetName(const char* name, const char* dir)
if(cmSystemTools::FileExists(hname.c_str()))
{
m_HeaderFileOnly = false;
+ m_ClassExtension = "txx";
m_FullPath = hname;
return;
}
hname = pathname;
hname += ".h";
- if(!cmSystemTools::FileExists(hname.c_str()))
+ if(cmSystemTools::FileExists(hname.c_str()))
{
- cmSystemTools::Error("can not find file ", hname.c_str());
- cmSystemTools::Error("Tried .txx .cxx .c for ", hname.c_str());
+ m_ClassExtension = "h";
+ m_FullPath = hname;
+ return;
}
+
+ cmSystemTools::Error("can not find file ", hname.c_str());
+ cmSystemTools::Error("Tried .txx .cxx .c for ", hname.c_str());
}
+void cmClassFile::SetName(const char* name, const char* dir, const char *ext,
+ bool hfo)
+{
+ m_HeaderFileOnly = hfo;
+ m_ClassName = name;
+ std::string pathname = dir;
+ if(pathname != "")
+ {
+ pathname += "/";
+ }
+
+ pathname += m_ClassName + "." + ext;
+ m_FullPath = pathname;
+ m_ClassExtension = ext;
+ return;
+}
void cmClassFile::Print()
{